From nobody Sun Oct 06 20:11:31 2024 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 4XMD2D1GFTz5YTmn; Sun, 06 Oct 2024 20:11:32 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XMD2D0kTQz4hST; Sun, 6 Oct 2024 20:11:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728245492; 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=Pv1yQrEVMWVB+d7idEQQRmw1eRvzAof3YQmZoC9K6Rs=; b=M5bUvg/FW+smL7S6JeFzKoiY0+nXtNAMgZzao9KIjw/5p8OzJsPIi6cufwkb0UgAMRZNld nJ9XeuglD+0FDgUbuZc84nbUv5E/9B55wH6WBy/v70fOtOfRymZsLOnFerXMjjcwkJkybw U50bi5D2wDidWy9wlp9RS17XIRyqnfQCBVBVmZZxW7CVDqtS3KkCGCAvH7UWzpWpPsxFw0 3As9QKgEJ1m/p8AOw9YXm8lxOMAby7Y56arbT9eayl7TUB+pQ3rYk/GvEzpp5tQxyJcxXV RZuJlGjfjNHrN17rD5DT+/PjUT7ihpLcFM1HUDKjUe98B4FnjeJBvKlkZ0bdzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728245492; 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=Pv1yQrEVMWVB+d7idEQQRmw1eRvzAof3YQmZoC9K6Rs=; b=L3aOiD8D0aK0RSRScuruYzl1AXJ0ztnL1thG1Yk5nDXZcpIA3Le/9efpD7lWwNlgShEnQT SuVK3pn17P981ni8bOoYGDiozglFyCdbwZSnJvaxHuQYnYNJbxV3tMCyRmW2CuG9loRWB9 gdJvPjZKstNPWTjnlIPsq14Rokhdz4kXWlH4wGpJe9XA0kclb5z3ll8MoxeAbuBz0Me0ig m4RC3w3TmMu4LS8R8cHK87nF/98JwuABkYFJGh41uzzISDz1YSvtPiN2uostXxPCiJeXCX M1fCw1nIJZY6bIWDxceL0C7SZTn2PzxEEM5Xsrc8pMmV5Oqiv0vqyszvizTSKg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728245492; a=rsa-sha256; cv=none; b=nUupTgNblW8e5Ih7elrOBANlXiAM2K6kbID0Ago7uk8XyybE4L24o/MiIj7Wk103wwwp2Z gSFdxfC613ITGMl2AYDaFgrdNq9wN0BXTMn2LtkzP7bFlMoqG4Thpondo+x/09/c8oDlEX N0o46s5upuDdaWwoT6YXKOd8GTQuZ/OIhBswk2DM2NywlScvTSBU1huEnr2P0zRAxkbMe2 UPG6D6gqVM8WQY6Vk6yXIytEuE84nKPGLDKf7b+1oQqIGanC/q1aTKof3RO4cFrQk4M8ai eUifz7b0GqySH93PG/dZs1xPlDdHKcCQIHrAG5eVgbKj+QpElUhSbEwloHhOFA== 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 4XMD2D0L1lzGlf; Sun, 6 Oct 2024 20:11:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 496KBVRt068884; Sun, 6 Oct 2024 20:11:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 496KBVFq068881; Sun, 6 Oct 2024 20:11:31 GMT (envelope-from git) Date: Sun, 6 Oct 2024 20:11:31 GMT Message-Id: <202410062011.496KBVFq068881@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Doug Moore Subject: git: 9147a0c93bc0 - main - pctrie: don't assign to root 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dougm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9147a0c93bc0b93d2d9d11e0a5a4a7358d04137a Auto-Submitted: auto-generated The branch main has been updated by dougm: URL: https://cgit.FreeBSD.org/src/commit/?id=9147a0c93bc0b93d2d9d11e0a5a4a7358d04137a commit 9147a0c93bc0b93d2d9d11e0a5a4a7358d04137a Author: Doug Moore AuthorDate: 2024-10-06 20:10:10 +0000 Commit: Doug Moore CommitDate: 2024-10-06 20:10:10 +0000 pctrie: don't assign to root User pctrie_root_store(*, PCTRIE_LOCKED) to change the root value of a pctrie, to ensure proper synchronization when smr is in use. Reviewed by: alc Differential Revision: https://reviews.freebsd.org/D46968 --- sys/kern/subr_pctrie.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/kern/subr_pctrie.c b/sys/kern/subr_pctrie.c index b461ffa3c5be..a7b487166054 100644 --- a/sys/kern/subr_pctrie.c +++ b/sys/kern/subr_pctrie.c @@ -304,7 +304,8 @@ pctrie_insert_lookup_compound(struct pctrie *ptree, uint64_t *val, if (pctrie_isleaf(node)) { if (node == PCTRIE_NULL) { if (parent == NULL) - ptree->pt_root = pctrie_toleaf(val); + pctrie_root_store(ptree, + pctrie_toleaf(val), PCTRIE_LOCKED); else pctrie_addnode(parent, index, pctrie_toleaf(val), PCTRIE_LOCKED); @@ -1242,7 +1243,8 @@ pctrie_replace(struct pctrie *ptree, uint64_t *newval) if (pctrie_isleaf(node)) { if ((m = pctrie_toval(node)) != NULL && *m == index) { if (parent == NULL) - ptree->pt_root = leaf; + pctrie_root_store(ptree, + leaf, PCTRIE_LOCKED); else pctrie_node_store( &parent->pn_child[slot], leaf,