All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
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
Subject: + mm-hugetlb_vmemmap-open-code-free_vmemmap_page.patch added to mm-new branch
Date: Tue, 01 Dec 2026 13:27:00 -0800	[thread overview]
Message-ID: <20261201212700.C20161F0089A@smtp.kernel.org> (raw)
In-Reply-To: <20261201095840.3034368-5-songmuchun@bytedance.com>


The patch titled
     Subject: mm/hugetlb_vmemmap: open-code free_vmemmap_page()
has been added to the -mm mm-new branch.  Its filename is
     mm-hugetlb_vmemmap-open-code-free_vmemmap_page.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-open-code-free_vmemmap_page.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 <songmuchun@bytedance.com>
Subject: mm/hugetlb_vmemmap: open-code free_vmemmap_page()
Date: Tue, 01 Dec 2026 17:58:38 +0800

free_vmemmap_page() has a single caller. Open-code it in
free_vmemmap_page_list() and remove the helper.

No functional change.

Link: https://patch.msgid.link/20261201095840.3034368-5-songmuchun@bytedance.com
Signed-off-by: Muchun Song <songmuchun@bytedance.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Lance Yang <lance.yang@linux.dev>
Cc: Oscar Salvador <osalvador@suse.de>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: David Hildenbrand <david@kernel.org>
Cc: Qi Zheng <qi.zheng@linux.dev>
Cc: nobody <nobody@kernel.org>

 mm/hugetlb_vmemmap.c |   29 +++++++++--------------------
 1 file changed, 9 insertions(+), 20 deletions(-)

--- a/mm/hugetlb_vmemmap.c~mm-hugetlb_vmemmap-open-code-free_vmemmap_page
+++ a/mm/hugetlb_vmemmap.c
@@ -172,30 +172,19 @@ static int vmemmap_remap_range(unsigned
 	return 0;
 }
 
-/*
- * Free a vmemmap page. A vmemmap page can be allocated from the memblock
- * allocator or buddy allocator. If the PG_reserved flag is set, it means
- * that it allocated from the memblock allocator, just free it via the
- * free_reserved_page(). Otherwise, use __free_page().
- */
-static inline void free_vmemmap_page(struct page *page)
-{
-	if (PageReserved(page)) {
-		memmap_boot_pages_add(-1);
-		free_reserved_page(page);
-	} else {
-		memmap_pages_add(-1);
-		__free_page(page);
-	}
-}
-
-/* Free a list of the vmemmap pages */
 static void free_vmemmap_page_list(struct list_head *list)
 {
 	struct page *page, *next;
 
-	list_for_each_entry_safe(page, next, list, lru)
-		free_vmemmap_page(page);
+	list_for_each_entry_safe(page, next, list, lru) {
+		if (PageReserved(page)) {
+			memmap_boot_pages_add(-1);
+			free_reserved_page(page);
+		} else {
+			memmap_pages_add(-1);
+			__free_page(page);
+		}
+	}
 }
 
 static int alloc_vmemmap_page_list(struct list_head *head,
_

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


  reply	other threads:[~2026-12-01 21:27 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-01  9:58 [PATCH v2 0/6] mm: Simplify HugeTLB vmemmap optimization code Muchun Song
2026-12-01  9:58 ` [PATCH v2 1/6] mm/hugetlb_vmemmap: remove the vmemmap savings boot message Muchun Song
2026-12-01 21:26   ` + mm-hugetlb_vmemmap-remove-the-vmemmap-savings-boot-message.patch added to mm-new branch Andrew Morton
2026-12-01  9:58 ` [PATCH v2 2/6] mm/hugetlb_vmemmap: fold vmemmap_should_optimize() into its callers Muchun Song
2026-12-01 21:26   ` + mm-hugetlb_vmemmap-fold-vmemmap_should_optimize-into-its-callers.patch added to mm-new branch Andrew Morton
2026-12-01  9:58 ` [PATCH v2 3/6] mm/hugetlb_vmemmap: drop the redundant hstate argument Muchun Song
2026-12-01 21:26   ` + mm-hugetlb_vmemmap-drop-the-redundant-hstate-argument.patch added to mm-new branch Andrew Morton
2026-12-01  9:58 ` [PATCH v2 4/6] mm/hugetlb_vmemmap: open-code free_vmemmap_page() Muchun Song
2026-12-01 21:27   ` Andrew Morton [this message]
2026-12-01  9:58 ` [PATCH v2 5/6] mm/hugetlb_vmemmap: drop obsolete restore refcount warning Muchun Song
2026-12-01 21:27   ` + mm-hugetlb_vmemmap-drop-obsolete-restore-refcount-warning.patch added to mm-new branch Andrew Morton
2026-12-01  9:58 ` [PATCH v2 6/6] mm/vmemmap-optimization: centralize the vmemmap optimization support check Muchun Song
2026-12-01 21:27   ` + mm-vmemmap-optimization-centralize-the-vmemmap-optimization-support-check.patch added to mm-new branch Andrew Morton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261201212700.C20161F0089A@smtp.kernel.org \
    --to=akpm@linux-foundation.org \
    --cc=david@kernel.org \
    --cc=lance.yang@linux.dev \
    --cc=mm-commits@vger.kernel.org \
    --cc=nobody@kernel.org \
    --cc=osalvador@suse.de \
    --cc=qi.zheng@linux.dev \
    --cc=rppt@kernel.org \
    --cc=songmuchun@bytedance.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.