From nobody Wed Sep 02 14:06:54 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 4hZl0H1Dvmz6q6cY for ; Wed, 02 Sep 2026 14:06:55 +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 "YR2" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4hZl0G5pHGz3Mpk for ; Wed, 02 Sep 2026 14:06:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1788358014; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vyTgotCp2Ne13RfM6Z8TAIr/zNAKm0GaKuHHMAVRi0E=; b=h/rAWZBaE0y2CaZkZA8pGPfZgk8D2h+feiYErVA40OzeGU3RXDgqPk2C5Mzc3XXWFhTPJs u9us04F5skDZnq/Y+Wnje4aZ8FlIyOz4Ep4LUaFE/LtLenf9nRF1vYvNeIazSuD4Nmddr7 9iPAlgBBz9SZAzerXD1vQzmnF3+YzqIpVxmgyJJ3q/TfNftMGhpam+9q1RQ2Y0C7F5s7Ie s5APT7dSVl/XFKeB/x3nHeYlQR4rJSem5xmP8jg3dwVM9CNeVJsIzg5fDzazfuAhp+Tso6 gWKNVZ5p+IV/cIWh/ZjhXsu4ZymkP9OEfUaMBJIdQuN0n4uAw79+YKEOiAZxVQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1788358014; a=rsa-sha256; cv=none; b=fU7uZOhmV7cTHO0MXtlf6xa6nkPRZeXnfyzB+++tH3A0MUw3VW64Pei2qoRRwH89SCP9de 3UCBu5OxpJ+GoZsWRft/7iMrtG7WWoDleK+KQ/l3RGUA33B9EdNYqhWhtw2C0PvXNlKCVp 7FygO8ICnD17ygyGHFdo9GK8qzKPdBpz+YKlbaHLAX5NNufkuxI1FbC0X/w3/9EA+2lLMA GFJ11hJH81QeErsencCyJyp2YzWOgiVEsEcgXn6/48LBrP1sPTOIhmR/JxhEshbIKfHO1G lp4nk1Q0f4CdUFWmDXdcXK4SRNVKCpcy7H758reTWiPqg1ZZACiUTMQcZGyc1w== 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=1788358014; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vyTgotCp2Ne13RfM6Z8TAIr/zNAKm0GaKuHHMAVRi0E=; b=tk3M0U7dZOpAxzB3RJDgFZQtOvR0Eq810JLcoBL5+9gZ9pmoC/g22J/tPb/vvvO2k1Qsr+ +LL7BfI1/b8DLisIkWy38Sw1ZMS8l7MbboGaaR6Vp1k4eB0rgSgtZMBvoI5KaWn+/dGRps lefYKlc2G74ytOo/TGb14f/CbgpQbhD3lKqua2va9M4o8LHX3a6uBAOzACmkQu0lhYVbfY cascQO+wyixPzbE5rxZazpCywUmFS9E0PrVyiPPrEz/KF1LcXnmDqPtwRTriGwXoZF3o8l zrJ+XvXQIEZbFCtqBokjqk9AgdjJCOC4fYNmvhu3dXhlu7DdtOv/tXZWvdPAsg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hZl0G3SK4zn52 for ; Wed, 02 Sep 2026 14:06:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1fb44 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 02 Sep 2026 14:06:54 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Kajetan Puchalski From: Alexander Ziaee Subject: git: 792c94293e21 - main - sys/conf/options: Add WITNESS_LOCK_CHILDCOUNT 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: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 792c94293e217d77d9eb8871ce3b53898ece0f9a Auto-Submitted: auto-generated Date: Wed, 02 Sep 2026 14:06:54 +0000 Message-Id: <6a982d7e.1fb44.541b6faf@gitrepo.freebsd.org> The branch main has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=792c94293e217d77d9eb8871ce3b53898ece0f9a commit 792c94293e217d77d9eb8871ce3b53898ece0f9a Author: Kajetan Puchalski AuthorDate: 2026-08-27 14:37:14 +0000 Commit: Alexander Ziaee CommitDate: 2026-09-02 14:04:45 +0000 sys/conf/options: Add WITNESS_LOCK_CHILDCOUNT Make the witness LOCK_CHILDCOUNT a configurable kernel option. On machines with a very high core count the default value is too low, leading to witness exhaustion after boot. Relnotes: yes Reviewed by: kib, ziaee Signed-off-by: Kajetan Puchalski Closes: https://github.com/freebsd/freebsd-src/pull/2398 --- share/man/man4/witness.4 | 14 +++++++++++++- sys/conf/options | 1 + sys/kern/subr_witness.c | 14 ++++++++++---- 3 files changed, 24 insertions(+), 5 deletions(-) diff --git a/share/man/man4/witness.4 b/share/man/man4/witness.4 index 9016da3b39c6..c777d116f7ec 100644 --- a/share/man/man4/witness.4 +++ b/share/man/man4/witness.4 @@ -21,7 +21,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd January 26, 2026 +.Dd September 1, 2026 .Dt WITNESS 4 .Os .Sh NAME @@ -30,6 +30,7 @@ .Sh SYNOPSIS .Cd options WITNESS .Cd options WITNESS_COUNT +.Cd options WITNESS_LOCK_CHILDCOUNT=number .Cd options WITNESS_KDB .Cd options WITNESS_NO_VNODE .Cd options WITNESS_SKIPSPIN @@ -71,6 +72,17 @@ via the environment variable. .Pp The +.Dv WITNESS_LOCK_CHILDCOUNT +kernel option specifies the number of entries in the statically allocated +pool used by +.Nm +to record lock-order relationships. +The value must be greater than zero. +The default is 2048. +Increasing this value permits more relationships to be tracked at the cost +of additional kernel memory. +.Pp +The .Dv WITNESS_NO_VNODE kernel option tells .Nm diff --git a/sys/conf/options b/sys/conf/options index 8a9bee6ff5d3..03b9f1472904 100644 --- a/sys/conf/options +++ b/sys/conf/options @@ -702,6 +702,7 @@ WITNESS_KDB opt_witness.h WITNESS_NO_VNODE opt_witness.h WITNESS_SKIPSPIN opt_witness.h WITNESS_COUNT opt_witness.h +WITNESS_LOCK_CHILDCOUNT opt_witness.h OPENSOLARIS_WITNESS opt_global.h EPOCH_TRACE opt_global.h diff --git a/sys/kern/subr_witness.c b/sys/kern/subr_witness.c index 92fa8c0799d8..9825db85b673 100644 --- a/sys/kern/subr_witness.c +++ b/sys/kern/subr_witness.c @@ -148,7 +148,13 @@ * probably be safe for the most part, but it's still a SWAG. */ #define LOCK_NCHILDREN 5 -#define LOCK_CHILDCOUNT 2048 +#ifndef WITNESS_LOCK_CHILDCOUNT +#define WITNESS_LOCK_CHILDCOUNT 2048 +#endif + +#if WITNESS_LOCK_CHILDCOUNT < 1 + #error "WITNESS_LOCK_CHILDCOUNT must be greater than zero" +#endif #define MAX_W_NAME 64 @@ -484,7 +490,7 @@ SYSCTL_INT(_debug_witness, OID_AUTO, sleep_cnt, CTLFLAG_RD, &w_sleep_cnt, 0, static struct witness *w_data; static uint8_t **w_rmatrix; -static struct lock_list_entry w_locklistdata[LOCK_CHILDCOUNT]; +static struct lock_list_entry w_locklistdata[WITNESS_LOCK_CHILDCOUNT]; static struct witness_hash w_hash; /* The witness hash table. */ static u_long w_sz; /* Witness startup memory allocation size */ @@ -928,7 +934,7 @@ witness_startup(void *mem) (witness_count + 1)); } - for (i = 0; i < LOCK_CHILDCOUNT; i++) + for (i = 0; i < WITNESS_LOCK_CHILDCOUNT; i++) witness_lock_list_free(&w_locklistdata[i]); witness_init_hash_tables(); @@ -1611,7 +1617,7 @@ witness_checkorder(struct lock_object *lock, int flags, const char *file, int trace; bool pstackv; - MPASS(j < LOCK_CHILDCOUNT * LOCK_NCHILDREN); + MPASS(j < WITNESS_LOCK_CHILDCOUNT * LOCK_NCHILDREN); lock1 = &lle->ll_children[i]; /*