From nobody Thu Jun 18 04:17:16 2026 X-Original-To: dev-commits-src-main@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 4ggnW129psz6jNf5 for ; Thu, 18 Jun 2026 04:17:17 +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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ggnW10wgMz3kYf for ; Thu, 18 Jun 2026 04:17:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781756237; 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=XR9AkLgIe3sMjCON4BoorYC6CuxfkGGtSxxGdmkkNl8=; b=BpZtukXjZEIomMxBskse9fvvMnOhb4R8cqGdW/Efir/1zMAzruCuZialGC7CSP0eZhsLNW Vzfc/aZ94DUsG5xlRfav9yjbK/lc728TbBagTVsM1w8Cs1uhj2LSuhAwuQvmM+YA9EeR7S +0pDoOpFOOTEhYLQdfAe17BNdSs+io9TCFsGfeRoqyo77T9Qk+caNJRc20T3Xpz6wZgclR J257U+SeNPq0sSSJYKnDwy2I2jAidBNaL5anxz0HPttDm4d4aMw9LHonV7rlH5rQupBRUv TZa0L/PJ/orQY5C76i3yLLhleII1+FI2QyLL37txGA+jadZjqvndRtnK6JHZsQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781756237; a=rsa-sha256; cv=none; b=CCcKhF5tyzvi29B3fdY3R/Xx3+Tdg4a3nGPW4ZqyEcVl3JsPOASkeuokcBscYWNhHf/Liz +DoDVM0V18R4KR5eiOdRYZRVMFxezzlKZpBpLm45RuWj624zuRWIbx1+7d0IU9cFQHSi2S +PM2ftL+XGnTdVkf5/8HY+9rlZQur+QZsQkqYJhV7eSjvmLUtTl3AyuU0bAMpL1H/w+pAv +TKy4LysOvwA3jace28LZ/CoU9W9R9Mb0IP3QYk9UfXfak/e538vQXthhy7oCC1jt/EYDk LU2YBcvAk25btRg+0vKTNEP9w0gvSOqaRX+qVh6zK/StL9KZXKbW2AbZzNXaiQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781756237; 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=XR9AkLgIe3sMjCON4BoorYC6CuxfkGGtSxxGdmkkNl8=; b=seRKwC1RLw02wnBLoB0k+ttZAK7Rmmx6jchBLMAFTHeo4iSiRoNymRgVIOt5uj1qPqA9wI D1Kib4kxCbr7bSiILLLuPoHqZI1fpL3w1eLxExb9qlMljFd61MafgHR0KTyLfc4zi6NIlj zNT8wFGKvzDvGxhP7aYEU4ppJaz9lIz2YIVd66di+TpvSAkFnhRv6qzAcfJjcHh6DB9/S+ +mUfz7ZKOLb701+tMNyB43+7trJDZndBNOXoD1V6cM0/hkLe+/Lvi5QrGzsEwYYY26UHev DFKNsFcjoQ8VFc1OYmp7w1kSlEguzp8SnI7bL+o9YOm+nm6fp0GP7Q0UAfHVxQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4ggnW06HQxzjh6 for ; Thu, 18 Jun 2026 04:17:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 187fe by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 18 Jun 2026 04:17:16 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ryan Libby Subject: git: 08180f1b613b - main - witness: actually set read-only tunables in time for witness_startup List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org List-Id: 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: rlibby X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 08180f1b613b6fe000135efa28b7c3293cbf1683 Auto-Submitted: auto-generated Date: Thu, 18 Jun 2026 04:17:16 +0000 Message-Id: <6a33714c.187fe.20ec4acc@gitrepo.freebsd.org> The branch main has been updated by rlibby: URL: https://cgit.FreeBSD.org/src/commit/?id=08180f1b613b6fe000135efa28b7c3293cbf1683 commit 08180f1b613b6fe000135efa28b7c3293cbf1683 Author: Ryan Libby AuthorDate: 2026-06-18 03:52:53 +0000 Commit: Ryan Libby CommitDate: 2026-06-18 04:05:43 +0000 witness: actually set read-only tunables in time for witness_startup SYSCTL_XXX with CTLFLAG_RDTUN and without CTLFLAG_NOFETCH should not be used for values that are needed before SI_SUB_KLD. Otherwise they are tuned after they are needed. Set CTLFLAG_RDTUN | CTLFLAG_NOFETCH for the debug.witness.witness_count and debug.witness.skipspin sysctls and add separate tunables for them, which run at SI_SUB_TUNABLES time, i.e., in time for witness_startup. Reviewed by: kib, markj Sponsored by: Dell Inc. Differential Revision: https://reviews.freebsd.org/D57613 --- sys/kern/subr_witness.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/sys/kern/subr_witness.c b/sys/kern/subr_witness.c index 3c192b2b0dce..2bfd8711eed7 100644 --- a/sys/kern/subr_witness.c +++ b/sys/kern/subr_witness.c @@ -404,17 +404,22 @@ SYSCTL_INT(_debug_witness, OID_AUTO, trace, CTLFLAG_RWTUN, &witness_trace, 0, "" #endif /* DDB || KDB */ #ifdef WITNESS_SKIPSPIN -int witness_skipspin = 1; +static bool witness_skipspin = true; #else -int witness_skipspin = 0; +static bool witness_skipspin = false; #endif -SYSCTL_INT(_debug_witness, OID_AUTO, skipspin, CTLFLAG_RDTUN, &witness_skipspin, 0, ""); +SYSCTL_BOOL(_debug_witness, OID_AUTO, skipspin, + CTLFLAG_RDTUN | CTLFLAG_NOFETCH, &witness_skipspin, 0, + "Skip all witness checks on spin locks"); +TUNABLE_BOOL("debug.witness.skipspin", &witness_skipspin); int badstack_sbuf_size; -int witness_count = WITNESS_COUNT; -SYSCTL_INT(_debug_witness, OID_AUTO, witness_count, CTLFLAG_RDTUN, - &witness_count, 0, ""); +static u_long witness_count = WITNESS_COUNT; +SYSCTL_ULONG(_debug_witness, OID_AUTO, witness_count, + CTLFLAG_RDTUN | CTLFLAG_NOFETCH, &witness_count, 0, + "Maximum count of lock type entries"); +TUNABLE_ULONG("debug.witness.witness_count", &witness_count); /* * Output channel for witness messages. By default we print to the console. @@ -790,7 +795,8 @@ witness_startup_count(void) /* * The WITNESS-enabled diagnostic code. Note that the witness code does * assume that the early boot is single-threaded at least until after this - * routine is completed. + * routine is completed. This routine runs during SI_SUB_VM. Any read-only + * tunables need to have been initialized by now. */ void witness_startup(void *mem)