From nobody Thu Apr 16 15:56:50 2026 X-Original-To: dev-commits-src-branches@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 4fxN1G5Z76z6ZstS for ; Thu, 16 Apr 2026 15:56:50 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fxN1G41z6z3NY5 for ; Thu, 16 Apr 2026 15:56:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776355010; 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=cARPZNQzgrUtvvN7DkDecLQ3//syto4jt/lL+FoMOsM=; b=MVFw22x0BOjqihxqYVgv5r28DHX4o87+XYkBz4tfBvv54Dm4R63aGGpKTiYqBkQv9oV10i EfucO2p7r0Joyz7lsEWc9ZgDIiiMcmdxomFiRm9qa6kHrDdcArXx1MkRbe+t4wj0qX3E7p c60FOCnoaaSwTNr+4iLfd/zkVk0uuqfXUgozBQ1U0VXrRIpqAXke2fPJSRZI/6BScUSRCm OjxLnSx1p3HMqiKE6Y5/Y96xbn07YWA/J6PR+dmEg4iMeqY6lioelwaSbcCKjdxbvW4OwV FcGT96iqxKecY32LDKctpfxaEoRLVYq73lc+HqOzzSRNTFLhmRYtx9g4Bg6NKg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776355010; a=rsa-sha256; cv=none; b=A9aMa6F1uJtqXnYvJYePXIZoMlghqWyuju3Xa0oYoF2EGMjNmcdiE9/9GNhymOQzeBvP+B W2OfbZZu4mw1+y+tSsRyO2b+BDSLt5SZvXWQpWdEuftL8xcno44taPK9+gRxWzLu76alRz yJp2x85uCEIjawULRd+dIjGSjXd4+N/tmmCkyyUzKvLaWhIZ+3cPK3eNPBgsoNx5LQG63e Qmdldlhz7FQBPywtqp4r5N6nI74WQ8TDCix0Q+3A3RQSkfGnexHVAA3tYE39uPbaS1zHzR 2nVKoXcxyMajYojyxIKAvAgM7pdqYE0+IRYpF0tQPZzZppjJN6oNju07PGogKA== 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=1776355010; 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=cARPZNQzgrUtvvN7DkDecLQ3//syto4jt/lL+FoMOsM=; b=ToimpByWYAu9BUsNmv5fl1B4YNbjQEXsm7bEdvzrDffGdprlhmsQlH2ZlhU5gi6R2l+FW+ dsSoMM1yBj6omdr6e0VdqFrH/rmSSpJCGeRjiiLMDnof5If4Xto7BG+WFD96ED9MVG1KSk BtTxq4/a3tc71MNJLBV76vI7gHCmTYqN9ctZLr4HDklHCxCi8vTuphchYScYriRZPQl0S+ nv4z2jT5vtdNI1OmHpaRxqei4VupSREvPqN+F9ahl+z1ZK83aocK/rxBomPwOTmeypllnF dheSilENe64q/PDU+CmGql9aDBa6eeNqi6uPB1K6s7qRtR5QrcjQJlqao2JZEw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fxN1G360XzCY for ; Thu, 16 Apr 2026 15:56:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2361b by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 16 Apr 2026 15:56:50 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 90fc3831af15 - stable/15 - pmap: Do not use PMAP_LOCK_INIT with kernel_pmap List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 90fc3831af1568a465d6be3dc0f40c1a87285c7c Auto-Submitted: auto-generated Date: Thu, 16 Apr 2026 15:56:50 +0000 Message-Id: <69e106c2.2361b.7287d73d@gitrepo.freebsd.org> The branch stable/15 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=90fc3831af1568a465d6be3dc0f40c1a87285c7c commit 90fc3831af1568a465d6be3dc0f40c1a87285c7c Author: Mark Johnston AuthorDate: 2026-04-01 09:15:26 +0000 Commit: Mark Johnston CommitDate: 2026-04-16 15:56:26 +0000 pmap: Do not use PMAP_LOCK_INIT with kernel_pmap The kernel_pmap lock is a bit special: it does not need the DUPOK flag, and it really belongs to a different lock class. If it belongs to the same class as regular pmap locks, then witness may report warnings when performing UMA allocations under a regular pmap lock, if the allocation triggers a pmap_growkernel() call. Replace instances of PMAP_LOCK_INIT(kernel_pmap) with inline mtx_init() calls to silence some witness warnings for harmless behaviour I see with some uncommitted test programs. Reviewed by: alc, kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D56185 (cherry picked from commit c6a1c1260f02e44b7f44b1e3735ce5dbd785544d) --- sys/amd64/amd64/pmap.c | 2 +- sys/arm/arm/pmap-v6.c | 2 +- sys/arm64/arm64/pmap.c | 2 +- sys/i386/i386/pmap.c | 2 +- sys/powerpc/aim/mmu_oea.c | 2 +- sys/powerpc/aim/mmu_oea64.c | 2 +- sys/powerpc/aim/mmu_radix.c | 2 +- sys/powerpc/booke/pmap.c | 2 +- sys/riscv/riscv/pmap.c | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 8695dd61316e..956e9c5e78d2 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -2127,7 +2127,7 @@ pmap_bootstrap(vm_paddr_t *firstaddr) * DMAP_TO_PHYS()/PHYS_TO_DMAP() are functional only after * kva_layout is fixed. */ - PMAP_LOCK_INIT(kernel_pmap); + mtx_init(&kernel_pmap->pm_mtx, "kernel pmap", NULL, MTX_DEF); if (la57) { kva_layout = kva_layout_la57; vtoptem = ((1ul << (NPTEPGSHIFT + NPDEPGSHIFT + NPDPEPGSHIFT + diff --git a/sys/arm/arm/pmap-v6.c b/sys/arm/arm/pmap-v6.c index d67267bba4e2..00f9766e9a54 100644 --- a/sys/arm/arm/pmap-v6.c +++ b/sys/arm/arm/pmap-v6.c @@ -1173,7 +1173,7 @@ pmap_bootstrap(vm_offset_t firstaddr) /* * Initialize the kernel pmap (which is statically allocated). */ - PMAP_LOCK_INIT(kernel_pmap); + mtx_init(&kernel_pmap->pm_mtx, "kernel pmap", NULL, MTX_DEF); kernel_l1pa = (vm_paddr_t)kern_pt1; /* for libkvm */ kernel_pmap->pm_pt1 = kern_pt1; kernel_pmap->pm_pt2tab = kern_pt2tab; diff --git a/sys/arm64/arm64/pmap.c b/sys/arm64/arm64/pmap.c index 44ec9f1672fe..cae46f7c2f1e 100644 --- a/sys/arm64/arm64/pmap.c +++ b/sys/arm64/arm64/pmap.c @@ -1347,7 +1347,7 @@ pmap_bootstrap(void) /* Set this early so we can use the pagetable walking functions */ kernel_pmap_store.pm_l0 = pagetable_l0_ttbr1; - PMAP_LOCK_INIT(kernel_pmap); + mtx_init(&kernel_pmap->pm_mtx, "kernel pmap", NULL, MTX_DEF); kernel_pmap->pm_l0_paddr = pmap_early_vtophys((vm_offset_t)kernel_pmap_store.pm_l0); TAILQ_INIT(&kernel_pmap->pm_pvchunk); diff --git a/sys/i386/i386/pmap.c b/sys/i386/i386/pmap.c index 2f9e6ccf43a8..fd5ac272a441 100644 --- a/sys/i386/i386/pmap.c +++ b/sys/i386/i386/pmap.c @@ -630,7 +630,7 @@ __CONCAT(PMTYPE, bootstrap)(vm_paddr_t firstaddr) * Count bootstrap data as being resident in case any of this data is * later unmapped (using pmap_remove()) and freed. */ - PMAP_LOCK_INIT(kernel_pmap); + mtx_init(&kernel_pmap->pm_mtx, "kernel pmap", NULL, MTX_DEF); kernel_pmap->pm_pdir = IdlePTD; #ifdef PMAP_PAE_COMP kernel_pmap->pm_pdpt = IdlePDPT; diff --git a/sys/powerpc/aim/mmu_oea.c b/sys/powerpc/aim/mmu_oea.c index ae17b3289593..2783f460402b 100644 --- a/sys/powerpc/aim/mmu_oea.c +++ b/sys/powerpc/aim/mmu_oea.c @@ -878,7 +878,7 @@ moea_bootstrap(vm_offset_t kernelstart, vm_offset_t kernelend) /* * Initialize the kernel pmap (which is statically allocated). */ - PMAP_LOCK_INIT(kernel_pmap); + mtx_init(&kernel_pmap->pm_mtx, "kernel pmap", NULL, MTX_DEF); for (i = 0; i < 16; i++) kernel_pmap->pm_sr[i] = EMPTY_SEGMENT + i; CPU_FILL(&kernel_pmap->pm_active); diff --git a/sys/powerpc/aim/mmu_oea64.c b/sys/powerpc/aim/mmu_oea64.c index 01bf4c7e90a8..3eb9de8a16c2 100644 --- a/sys/powerpc/aim/mmu_oea64.c +++ b/sys/powerpc/aim/mmu_oea64.c @@ -1124,7 +1124,7 @@ moea64_mid_bootstrap(vm_offset_t kernelstart, vm_offset_t kernelend) CPU_FILL(&kernel_pmap->pm_active); RB_INIT(&kernel_pmap->pmap_pvo); - PMAP_LOCK_INIT(kernel_pmap); + mtx_init(&kernel_pmap->pm_mtx, "kernel pmap", NULL, MTX_DEF); /* * Now map in all the other buffers we allocated earlier diff --git a/sys/powerpc/aim/mmu_radix.c b/sys/powerpc/aim/mmu_radix.c index a12142fc2d7b..387c172b446c 100644 --- a/sys/powerpc/aim/mmu_radix.c +++ b/sys/powerpc/aim/mmu_radix.c @@ -1843,7 +1843,7 @@ mmu_radix_setup_pagetables(vm_size_t hwphyssz) vm_paddr_t l1phys; bzero(kernel_pmap, sizeof(struct pmap)); - PMAP_LOCK_INIT(kernel_pmap); + mtx_init(&kernel_pmap->pm_mtx, "kernel pmap", NULL, MTX_DEF); vm_radix_init(&kernel_pmap->pm_radix); ptpages = allocpages(3); diff --git a/sys/powerpc/booke/pmap.c b/sys/powerpc/booke/pmap.c index f76f17bd8450..08516b151e6b 100644 --- a/sys/powerpc/booke/pmap.c +++ b/sys/powerpc/booke/pmap.c @@ -901,7 +901,7 @@ mmu_booke_bootstrap(vm_offset_t start, vm_offset_t kernelend) /*******************************************************/ /* Initialize (statically allocated) kernel pmap. */ /*******************************************************/ - PMAP_LOCK_INIT(kernel_pmap); + mtx_init(&kernel_pmap->pm_mtx, "kernel pmap", NULL, MTX_DEF); debugf("kernel_pmap = 0x%"PRI0ptrX"\n", (uintptr_t)kernel_pmap); kernel_pte_alloc(virtual_avail, kernstart); diff --git a/sys/riscv/riscv/pmap.c b/sys/riscv/riscv/pmap.c index 3fc261a15c06..e9f88f5d653e 100644 --- a/sys/riscv/riscv/pmap.c +++ b/sys/riscv/riscv/pmap.c @@ -921,7 +921,7 @@ pmap_bootstrap(vm_paddr_t kernstart, vm_size_t kernlen) printf("pmap_bootstrap %lx %lx\n", kernstart, kernlen); - PMAP_LOCK_INIT(kernel_pmap); + mtx_init(&kernel_pmap->pm_mtx, "kernel pmap", NULL, MTX_DEF); TAILQ_INIT(&kernel_pmap->pm_pvchunk); vm_radix_init(&kernel_pmap->pm_root);