From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796160424; b=lYL1gW6NXFWeU1X0XNHzzLIUfutFVcXW9KBQha75VV+yr62ZWMvpt71r+DyXgIW0AK/W v/3amuvC4WzCyk5k0wBh9GOFtmMXDBsEvdMFcTRUH82tZxVm8Ig9AZJ0QHA6gpjIGYOV0 13203EOlrKv5cSvEKWrIfcIEnuY2mazpJSTuOOq4W0AOk3mFgs1G+P+PkeVtCwX3PHwiP IlOUtxcsYFV53ASRDFq5TksskgFUWJkfZfCeYzbo32pDhqXfXf2mGGVZ+8aLpvgMYVGFN yAt5DzCUkXPzHBKYF1aAY+NoOQSZurKaHhRDcrGeDuwrgCgEZcfPt8K63ign4vVRljA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796160424; h=Received:DKIM-Signature:Date:To:From:In-Reply-To:References:Subject: Message-Id; bh=z1DzM4hst8wVqNtEvKWTmqHY2WENyMnqhwidS5gYeAY=; b=s8EUstjE1YxPHaqLCUIKdJYG16OFYb/dX7JQgTyphy4sdYBjl+/w0L3N4luc4zOpsNnG bblWDS2eWyn/3a7UmLcMzFICKYDeu5U3tFVAodji6xc0tZ+2D2jJpudAWHmnYXtHrhuv+ Um/7H0q0R6Vce4j2qlFJJOitrLlld0p6gEsuXkmdLaNcdCvQeSbn6knFZ3qVmLhY8TUys zjNks3O2nzFAgggH9wjfj2P8JHy+Fq335coy13Zcl04hVTmF0UAsE9WDmGO08RnRgDPxL mcgy6B/ZzZ4JgR4INhmxVSg3X20FL8D9C8Gff3JEgJAislJTDMGhcYwf+BhYVUNB1Kg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linux-foundation.org header.i=@linux-foundation.org header.a=rsa-sha256 header.s=korg header.b=uVJ21yDZ; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 08513606A31A for ; Tue, 1 Dec 2026 21:27:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.a=rsa-sha256 header.s=korg header.b=uVJ21yDZ Received: by smtp.kernel.org (Postfix) with ESMTPSA id A3B0A1F000C1; Tue, 1 Dec 2026 21:27:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=korg; t=1796160423; bh=z1DzM4hst8wVqNtEvKWTmqHY2WENyMnqhwidS5gYeAY=; h=Date:To:From:In-Reply-To:References:Subject; b=uVJ21yDZWG42otfInW0zHFan3xohGKu3BHtcEdcjbolzmKYvUU5MSwDPOG8iVpOdO R8B6O6TxABuZwiKFgRtcqfnYq2685PKxryZEGLmzPIHf03YK0wUneYUfFyJ99ETkyy ku2iHfne5oCb2UE4iR4sTtPFeUOgXURCzSJraSsw= Date: Tue, 01 Dec 2026 13:27:03 -0800 To: mm-commits@vger.kernel.org,rppt@kernel.org,qi.zheng@linux.dev, osalvador@suse.de,nobody@kernel.org,lance.yang@linux.dev,david@kernel.org, songmuchun@bytedance.com,akpm@linux-foundation.org From: Andrew Morton In-Reply-To: <20261201095840.3034368-6-songmuchun@bytedance.com> References: <20261201095840.3034368-6-songmuchun@bytedance.com> Subject: + mm-hugetlb_vmemmap-drop-obsolete-restore-refcount-warning.patch added to mm-new branch Message-Id: <20261201212703.A3B0A1F000C1@smtp.kernel.org> X-Mailing-List: mm-commits@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list The patch titled Subject: mm/hugetlb_vmemmap: drop obsolete restore refcount warning has been added to the -mm mm-new branch. Its filename is mm-hugetlb_vmemmap-drop-obsolete-restore-refcount-warning.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-hugetlb_vmemmap-drop-obsolete-restore-refcount-warning.patch This patch will later appear in the mm-new branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Note, mm-new is a provisional staging ground for work-in-progress patches, and acceptance into mm-new is a notification for others take notice and to finish up reviews. Please do not hesitate to respond to review feedback and post updated versions to replace or incrementally fixup patches in mm-new. The mm-new branch of mm.git is not included in linux-next If a few days of testing in mm-new is successful, the patch will me moved into mm.git's mm-unstable branch, which is included in linux-next Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via various branches at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there most days ------------------------------------------------------ From: Muchun Song Subject: mm/hugetlb_vmemmap: drop obsolete restore refcount warning Date: Tue, 01 Dec 2026 17:58:39 +0800 Commit bd225530a4c7 ("mm/hugetlb_vmemmap: fix race with speculative PFN walkers") added this warning alongside RCU protection that serialized page_ref_add_unless() against HVO remapping. The zero head refcount was part of that protocol while the vmemmap was folded or unfolded. That RCU protection was later removed by commit 32c440d67e6c ("mm: drop fake head checks") and commit 01b1d0ffb6f7 ("hugetlb: remove VMEMMAP_SYNCHRONIZE_RCU"). Commit 0120a603afad ("mm/hugetlb_vmemmap: map the shared tail page writable") now handles the original race by allowing a late cmpxchg to fail safely against the zero refcount on the shared tail page. The head folio refcount no longer participates in this protection. Drop the stale warning from the restore path. The matching warning in the optimize path remains necessary because that path copies the head struct page. A zero refcount prevents concurrent users from acquiring a reference and writing to it during the copy. Document this requirement at the warning. Link: https://patch.msgid.link/20261201095840.3034368-6-songmuchun@bytedance.com Signed-off-by: Muchun Song Signed-off-by: Andrew Morton Reviewed-by: Lance Yang Cc: Oscar Salvador Cc: Mike Rapoport Cc: David Hildenbrand Cc: Qi Zheng Cc: nobody mm/hugetlb_vmemmap.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) --- a/mm/hugetlb_vmemmap.c~mm-hugetlb_vmemmap-drop-obsolete-restore-refcount-warning +++ a/mm/hugetlb_vmemmap.c @@ -348,6 +348,11 @@ static int vmemmap_optimize_folio(const rwsem_assert_held(&vmemmap_remap_rwsem); + /* + * The refcount must remain zero to prevent concurrent users from + * acquiring a reference and writing to the head struct page while it + * is copied during remapping. + */ VM_WARN_ON_ONCE_FOLIO(folio_ref_count(folio), folio); if (!vmemmap_optimizable_order(folio_order(folio))) @@ -408,7 +413,6 @@ static int __hugetlb_vmemmap_restore_fol int ret; VM_WARN_ON_ONCE_FOLIO(!folio_test_hugetlb(folio), folio); - VM_WARN_ON_ONCE_FOLIO(folio_ref_count(folio), folio); if (!folio_test_hugetlb_vmemmap_optimized(folio)) return 0; _ Patches currently in -mm which might be from songmuchun@bytedance.com are powerpc-mm-make-vmemmap_populate_compound_pages-static.patch powerpc-mm-drop-powerpc-vmemmap_can_optimize.patch mm-sparse-vmemmap-drop-vmemmap_can_optimize.patch mm-sparse-vmemmap-drop-pgmap-from-vmemmap-population-apis.patch mm-hugetlb_vmemmap-fix-hwpoison-state-races-during-optimization.patch mm-hugetlb_vmemmap-fix-pmd-split-tlb-flush-race.patch mm-hugetlb_vmemmap-fix-deadlock-during-pmd-split.patch mm-list_lru-fix-potential-infinite-loop-on-xa-node-allocation-failure.patch mm-mm_init-verify-zones-for-template-initialized-pages.patch mm-mm_init-factor-out-common-struct-page-initialization.patch mm-mm_init-simplify-zone-device-page-initialization.patch mm-mm_init-factor-out-compound-page-initialization.patch mm-hugetlb-drop-boot-time-hvo-handling-for-gigantic-folios.patch mm-hugetlb-initialize-all-struct-pages-for-bootmem-hugepages.patch mm-hugetlb-use-common-compound-page-initialization-helper.patch mm-mm_init-make-__init_single_page-static.patch mm-cma-centralize-cma-pageblock-initialization.patch mm-cma-localize-init_cma_pageblock-to-cmac.patch mm-mm_init-move-pageblock-migratetype-init-to-memmap-helpers.patch kmsan-encapsulate-per-page-metadata-access.patch mm-page_ext-fix-client-data-alignment.patch mm-page_ext-always-use-vmalloc-for-section-page-extensions.patch mm-page_ext-use-common-allocation-and-initialization-entry-points.patch mm-page_ext-allocate-page-extensions-early-for-sparsemem.patch mm-page_ext-inline-unchecked-page-extension-lookup.patch kmsan-fix-metadata-loss-during-hugetlb-struct-page-reinitialization.patch mm-hugetlb_vmemmap-remove-the-vmemmap-savings-boot-message.patch mm-hugetlb_vmemmap-fold-vmemmap_should_optimize-into-its-callers.patch mm-hugetlb_vmemmap-drop-the-redundant-hstate-argument.patch mm-hugetlb_vmemmap-open-code-free_vmemmap_page.patch mm-hugetlb_vmemmap-drop-obsolete-restore-refcount-warning.patch mm-vmemmap-optimization-centralize-the-vmemmap-optimization-support-check.patch