From nobody Thu Nov 05 16:00:45 2026 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 4jL6V53vBmz70Ggb for ; Thu, 05 Nov 2026 16:00:45 +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) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4jL6V52nB4z4Wl4 for ; Thu, 05 Nov 2026 16:00:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1793894445; 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=QJ48eCISXsb563Nfh/4qNLmM582MgiuNNxMLmUKM6sY=; b=jIyt3iKMaNSo3pQw16DtTlETl8lf9pBmuAzDl/Fg1AbzMcbieJ/qPTjqeieNljAAB3CeCo J/5cl3zmUx6oGUgSHuvikea20txo7xAPCVqam1XSAV7zqrdJTnSKSm4HYYZQ8CeepqSBw4 WzitiemTzHTc4i1SQLqozCKo6uCuHvsJJ6Juhpwuf0jWbcrtSVM1cFE98U8GZbntfaMxv+ KCzKUtmHqStYitZFlCYJIRmdBfcMqgXAu5ET1DzwaRxKDdif3/0S4JKdLAGNcX3BUpH6MW VWvq5tfgnZtsMD/G7hYedR8/zA5cFQ6/+BgeYXCfInkoR7VmPWbnLrZl0Ac4DA== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1793894445; b=sC87/FQAxxInWruPvjUdnzm4ZJHqOxPifPOngU8lbW3FOuF4SG+Y1wEI+4HHi57WpEBewJ TMZlllHwAdaScqkuB8EOQ3rtyNoeIl9odVw25KTslNHm2NGsB3T6TBsyr5j1NGSxGN9yyw BOTKsXfuhF55r3Zd+AnxwMFDBuWhdm4aiM4m3yO6s2AAthyKlDviYt8dtsQ0YoEQgY01u7 7vudLS/q17DzdWt007r0TY7ywqt/6j8twyZxguQvQSNV3PC/1fhSMFzLEo8ZQXk4dLbwZ6 TImdu+GzjE5sOxv9TNxji6BAChi5zlTkss3L8R+zNjCHwPTuXL1QPlN7mNiV/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1793894445; 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=QJ48eCISXsb563Nfh/4qNLmM582MgiuNNxMLmUKM6sY=; b=P/0edQ1eNlORL79S/EC5KQat5gac5yZpfsfYwU/oNTIoylRqpOe1//q86uWsyKe2KSvJXz vzeFOFUsWpdLkPvTQ4XnMkNR3lW9fwu4/eMDN4EVBPuFyX06l1eekp2YcjbZtct6rkMXb7 tsoekwGtE5awfHCn9y9EHxzzyorq34X79YqyK8QP2DZnDyLm0A/vijztnlEM8B0dMv7QVg 6Eo8frS+wRNI4Lh9LOeziuShfrPUbjtFXyZyObXld7hXfa2GqIrxbFFsnLpbMY9rVA1pj/ XgA3Q4+oiqEd9DHF4BsK5hu0nWvB/nvHnLcrTAOan4aWdShIW9qfk8zD8gcCKA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4jL6V52QlNzxXd for ; Thu, 05 Nov 2026 16:00:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 31f5e by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 05 Nov 2026 16:00:45 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: ShengYi Hung Subject: git: 71937d8e11a6 - main - libthr: Predict libthr is initialized in _thr_check_init List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org List-Id: Commit messages for all branches of the src repository List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: aokblast X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 71937d8e11a6b7fdb3c1b308d5f7c8b30dac5ca7 Auto-Submitted: auto-generated Date: Thu, 05 Nov 2026 16:00:45 +0000 Message-Id: <6aeca82d.31f5e.4a4e3c2@gitrepo.freebsd.org> The branch main has been updated by aokblast: URL: https://cgit.FreeBSD.org/src/commit/?id=71937d8e11a6b7fdb3c1b308d5f7c8b30dac5ca7 commit 71937d8e11a6b7fdb3c1b308d5f7c8b30dac5ca7 Author: ShengYi Hung AuthorDate: 2026-11-05 15:58:18 +0000 Commit: ShengYi Hung CommitDate: 2026-11-05 16:00:27 +0000 libthr: Predict libthr is initialized in _thr_check_init _thr_check_init() is called on hot paths such as pthread_once(), and the uninitialized case can only happen once. Mark it with __predict_false so the compiler lays out the initialized case as the fall-through path. Reviewed by: kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D61213 --- lib/libthr/thread/thr_private.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libthr/thread/thr_private.h b/lib/libthr/thread/thr_private.h index 4469533bc40e..3cc0fe61de00 100644 --- a/lib/libthr/thread/thr_private.h +++ b/lib/libthr/thread/thr_private.h @@ -945,7 +945,7 @@ _thr_is_inited(void) static inline void _thr_check_init(void) { - if (_thr_initial == NULL) + if (__predict_false(_thr_initial == NULL)) _libpthread_init(NULL); }