Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] mm: Track vmemmap optimization state in shared backing pages
@ 2026-12-04  6:50 Muchun Song
  2026-12-04  6:50 ` [PATCH 1/2] mm/vmemmap-optimization: track optimization state in shared vmemmap pages Muchun Song
  2026-12-04  6:50 ` [PATCH 2/2] mm/hugetlb_vmemmap: remove HPG_vmemmap_optimized Muchun Song
  0 siblings, 2 replies; 5+ messages in thread
From: Muchun Song @ 2026-12-04  6:50 UTC (permalink / raw)
  To: Oscar Salvador, David Hildenbrand, Mike Rapoport, Andrew Morton
  Cc: Muchun Song, Liam R . Howlett, Vlastimil Babka, Michal Hocko,
	Miaohe Lin, Naoya Horiguchi, Lance Yang, Qi Zheng, linux-mm,
	Muchun Song

Folio-based vmemmap optimization currently requires HugeTLB to maintain
HPG_vmemmap_optimized separately from the vmemmap mapping.  The runtime
update is counterintuitive: when TLB flushing is deferred, the flag must
be set before remapping so that it is copied to the replacement head
page, then cleared if optimization fails.  Boot-time HugeTLB setup also
needs an explicit transfer from section metadata into the flag.

The same representation is useful to future shared-vmemmap users [1].
The FS-DAX prototype currently determines whether a metadata page still
uses shared backing by looking up its vmemmap PTE and comparing the mapped
backing page with the shared template.  A future revision can instead
test the common flag directly through the vmemmap address, avoiding
page-table identity as the state representation for shared metadata.

Reuse PG_owner_2 in the first struct page slot of each shared backing
page, and provide folio_vmemmap_optimized() as the common query.  Patch 1
introduces the generic state representation and query.  Patch 2 switches
HugeTLB to it and removes the private flag and its explicit state updates.

[1] https://lore.kernel.org/20260903122128.12264-4-songmuchun@bytedance.com

Muchun Song (2):
  mm/vmemmap-optimization: track optimization state in shared vmemmap
    pages
  mm/hugetlb_vmemmap: remove HPG_vmemmap_optimized

 include/linux/hugetlb.h              |  3 --
 include/linux/page-flags.h           |  6 ++++
 include/linux/vmemmap-optimization.h | 12 ++++++-
 mm/hugetlb.c                         | 15 ++++-----
 mm/hugetlb_vmemmap.c                 | 47 ++++++----------------------
 mm/memory-failure.c                  |  4 +--
 mm/sparse-vmemmap.c                  |  1 +
 7 files changed, 36 insertions(+), 52 deletions(-)


base-commit: 1a7610248a3802e38124ce66b07eef12277be9a0
-- 
2.54.0



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-12-04  7:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-04  6:50 [PATCH 0/2] mm: Track vmemmap optimization state in shared backing pages Muchun Song
2026-12-04  6:50 ` [PATCH 1/2] mm/vmemmap-optimization: track optimization state in shared vmemmap pages Muchun Song
2026-12-04  7:23   ` sashiko-bot
2026-12-04  6:50 ` [PATCH 2/2] mm/hugetlb_vmemmap: remove HPG_vmemmap_optimized Muchun Song
2026-12-04  7:23   ` sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox