All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/7] mm: Generalize HVO vmemmap population
@ 2026-12-05  3:26 Muchun Song
  2026-12-05  3:26 ` [PATCH v2 1/7] mm/sparse-vmemmap: use page-table constructors for runtime tables Muchun Song
                   ` (6 more replies)
  0 siblings, 7 replies; 13+ messages in thread
From: Muchun Song @ 2026-12-05  3:26 UTC (permalink / raw)
  To: Andrew Morton, Mike Rapoport, Madhavan Srinivasan
  Cc: Muchun Song, David Hildenbrand, Michael Ellerman, Ritesh Harjani,
	Aneesh Kumar K . V, Pavithra Prakash, Lance Yang, Qi Zheng,
	linux-mm, linuxppc-dev, Muchun Song, Chris Down

PowerPC radix currently uses a private HVO vmemmap population path because
the generic path lacks several properties it requires. This duplicates the
generic sparse-vmemmap page-table walk even though the HVO layout itself
does not require architecture-specific handling.

First, PowerPC uses the regular page-table allocators for runtime vmemmap
tables, while the generic path uses vmemmap_alloc_block() for intermediate
tables, bypassing the normal page-table constructor and destructor
lifecycle.

Second, with 64 KiB base pages, multiple sparsemem sections can share one
vmemmap PTE. The generic HVO path rejects an existing PTE even when it maps
the expected shared tail page.

Third, a PMD-sized vmemmap mapping can also span multiple sections. An
HVO-capable section can therefore encounter an ordinary mapping created
for a neighboring section. The generic path rejects it instead of reusing
it and disabling HVO for the current section.

Fourth, the HVO path maps the vmemmap with PTEs, and PowerPC needs a
ptesync once they are set. Its radix__vmemmap_pte_populate() issued one
for every PTE, while the generic vmemmap_pte_populate() did not. The
generic path now calls flush_cache_vmap() after population, which is a
ptesync on PowerPC, so the per-PTE ptesync can be removed.

This series removes these restrictions. Patches 1 and 2 address the first
issue, patch 3 the second, patch 4 the third, and patch 5 the fourth.

Patch 6 is a standalone fix posted earlier but not yet merged:

  https://lore.kernel.org/all/20261030115326.1005755-1-songmuchun@bytedance.com/

Since the final conversion removes the affected PowerPC code, carrying the
fix here preserves it as a distinct commit that can be backported to
kernels using the old implementation.

Patch 7 then removes the PowerPC HVO page-table walk and switches radix
to the generic path.

v2:
- Swap patches 5 and 6
- Patch 1: use memblock_alloc_try_nid() instead of an explicit memset()
  (suggested by Lance Yang)
- Patch 3: warn once when an existing PTE maps a page other than the
  expected shared tail page (suggested by Chris Down)
- Patch 5: note the removal of the per-PTE ptesync in the commit message
  (suggested by Lance Yang)
- Collect Reviewed-by from Chris Down for the series
- Collect Reviewed-by from Lance Yang and Tested-by from Chris Down

v1: https://lore.kernel.org/20261201115651.3400202-1-songmuchun@bytedance.com/

Muchun Song (7):
  mm/sparse-vmemmap: use page-table constructors for runtime tables
  mm/sparse-vmemmap: align page-table helpers with core MM
  mm/sparse-vmemmap: introduce vmemmap_optimizable_pte_populate
  mm/sparse-vmemmap: support PMD mappings spanning sections
  powerpc/mm: remove radix-specific vmemmap PMD overrides
  powerpc/mm: fix uninitialized ZONE_DEVICE struct pages with PMDs
  powerpc/mm: reuse generic HVO vmemmap population

 arch/powerpc/mm/book3s64/radix_pgtable.c | 167 ++---------------
 mm/sparse-vmemmap.c                      | 218 ++++++++++++++---------
 2 files changed, 147 insertions(+), 238 deletions(-)


base-commit: d0d65ff2e433e741c23715e8359c4a248d432179
-- 
2.54.0



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

end of thread, other threads:[~2026-12-05  5:03 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-05  3:26 [PATCH v2 0/7] mm: Generalize HVO vmemmap population Muchun Song
2026-12-05  3:26 ` [PATCH v2 1/7] mm/sparse-vmemmap: use page-table constructors for runtime tables Muchun Song
2026-12-05  3:26 ` [PATCH v2 2/7] mm/sparse-vmemmap: align page-table helpers with core MM Muchun Song
2026-12-05  3:26 ` [PATCH v2 3/7] mm/sparse-vmemmap: introduce vmemmap_optimizable_pte_populate Muchun Song
2026-12-05  3:26 ` [PATCH v2 4/7] mm/sparse-vmemmap: support PMD mappings spanning sections Muchun Song
2026-12-05  4:01   ` sashiko-bot
2026-12-05  4:47     ` Muchun Song
2026-12-05  3:26 ` [PATCH v2 5/7] powerpc/mm: remove radix-specific vmemmap PMD overrides Muchun Song
2026-12-05  4:01   ` sashiko-bot
2026-12-05  4:50     ` Muchun Song
2026-12-05  5:02   ` [PATCH] fixup! " Muchun Song
2026-12-05  3:26 ` [PATCH v2 6/7] powerpc/mm: fix uninitialized ZONE_DEVICE struct pages with PMDs Muchun Song
2026-12-05  3:26 ` [PATCH v2 7/7] powerpc/mm: reuse generic HVO vmemmap population Muchun Song

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.