From nobody Wed Dec 22 10:06:26 2021 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 18D5F1906917; Wed, 22 Dec 2021 10:06:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JJprP32cFz4Yx6; Wed, 22 Dec 2021 10:06:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C17C31B2CF; Wed, 22 Dec 2021 10:06:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1BMA6Qji092684; Wed, 22 Dec 2021 10:06:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BMA6QQr092683; Wed, 22 Dec 2021 10:06:26 GMT (envelope-from git) Date: Wed, 22 Dec 2021 10:06:26 GMT Message-Id: <202112221006.1BMA6QQr092683@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 39e8b505feb0 - stable/12 - Revert r367815, so we can apply the slightly different version that landed upstream: List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 39e8b505feb0dcfef4c8e794d252f1d402be3f5f Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1640167592; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OPNEox1qCKFfgyzSvUG1ycGu9ir9oH3JU/CKdE7rT7s=; b=kPONynJYdvwK/MHAL2zB6QMYpIAv0F57CFSjUnnFhRivd0ZAU/4tZz2o1EQpNv7T9AL5IV tpev46LRcRtTe7Gu1DUVmOT9hMt33id4OWswt88RX3XzwJ1qw1B/u5BB33ylJIj6fmeSFW 9FYHh0lfnvbJ0AUaxhUccIiGsvLS9V1fhtAxUSvoQJmlGltsNVBoj/haJzTJikuoXALVLK PzHwSYugaHGCLeawSfiyA/sojnw7bX41zicihMuVuRpNAePQjPrpYON52prmWNs7+QFjNI ozalxxsJV+wps9epa2HBlzSvNR4CK/Tz2BOvsJ9ZEZs8pEa38bR+s5HfTe/AzQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1640167592; a=rsa-sha256; cv=none; b=lNYdVeghdenYOh2dPGKczAHbPlJg6oFN78WPvvXo6s9byFfkJbFTAF1YZVqbJ9O1jWmXp/ 79TQSQ0fmyV0QPJD07LNEPTQoG1XBXS8J77y2ESqwiEW7dL6zfDY/2dK6OanLJdhA3M1BN ZC4nZlAqyzUrb52N4xUSWAHb0QknAZZi1PgUnZjlBd/EtFFAkKrWXr41ACxgtfsIt8bdfW 29A8wCxXxQepM0bdmlJauURJE/AOCiGVQoa+Np8WzXR+CFxMp9o2TU5A8xlICUX7OcDIGa 1mr1BfBeD6U/b0gYqcGfdZRGZTeKr8lGUfenlJqpy+1QR7nngthT1rQY7SXbAQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=39e8b505feb0dcfef4c8e794d252f1d402be3f5f commit 39e8b505feb0dcfef4c8e794d252f1d402be3f5f Author: Dimitry Andric AuthorDate: 2020-12-03 19:26:21 +0000 Commit: Dimitry Andric CommitDate: 2021-12-22 10:01:23 +0000 Revert r367815, so we can apply the slightly different version that landed upstream: For llvm's internal function which retrieves the number of available "hardware threads", use cpuset_getaffinity(2) on FreeBSD, so it will honor processor sets configured by the cpuset(1) command. This should make it possible to avoid e.g. lld creating a huge number of threads on a machine with many cores, even for linking simple programs. This will also be submitted upstream. Submitted by: mjg (cherry picked from commit 5cc6cb2645b79b6108922957984dd86077cd7f06) --- contrib/llvm-project/llvm/lib/Support/Unix/Threading.inc | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/contrib/llvm-project/llvm/lib/Support/Unix/Threading.inc b/contrib/llvm-project/llvm/lib/Support/Unix/Threading.inc index df290d2262ea..2d0aacabf092 100644 --- a/contrib/llvm-project/llvm/lib/Support/Unix/Threading.inc +++ b/contrib/llvm-project/llvm/lib/Support/Unix/Threading.inc @@ -26,10 +26,6 @@ #include // For pthread_getthreadid_np() / pthread_set_name_np() #endif -#if defined(__FreeBSD__) -#include -#endif - #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) #include #include @@ -286,13 +282,6 @@ SetThreadPriorityResult llvm::set_thread_priority(ThreadPriority Priority) { #include int computeHostNumHardwareThreads() { -#ifdef __FreeBSD__ - cpuset_t mask; - CPU_ZERO(&mask); - if (cpuset_getaffinity(CPU_LEVEL_WHICH, CPU_WHICH_TID, -1, sizeof(mask), - &mask) == 0) - return CPU_COUNT(&mask); -#endif #ifdef __linux__ cpu_set_t Set; if (sched_getaffinity(0, sizeof(Set), &Set) == 0)