mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v3 0/4] mm: Fix page-table teardown during memory hot-remove
@ 2026-10-23  6:34 Muchun Song
  2026-10-23  6:34 ` [PATCH v3 1/4] mm: fix missing page-table destructor in pagetable_free() Muchun Song
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Muchun Song @ 2026-10-23  6:34 UTC (permalink / raw)
  To: Andrew Morton
  Cc: David Hildenbrand, Oscar Salvador, Dave Hansen, Paul Walmsley,
	Palmer Dabbelt, Albert Ou, Alexandre Ghiti,
	Björn Töpel, Catalin Marinas, Will Deacon,
	Mark Rutland, Kevin Brodsky, Alexander Gordeev, Alistair Popple,
	linux-mm, linux-riscv, linux-arm-kernel, linux-kernel, stable,
	Muchun Song, Muchun Song

Memory hot-remove can free page-table pages allocated through paths with
different constructor state. Some paths run the page-table constructor,
while generic sparse-vmemmap population may not. The x86, RISC-V, and
arm64 teardown paths did not handle that distinction consistently,
leaving constructor/destructor accounting unbalanced.

Make pagetable_free() handle any remaining constructor state before
freeing a page-table page. Callers that already ran pagetable_dtor()
have cleared that state, so the destructor is not run twice. The RISC-V
and arm64 fixes then use this common helper for their memory-hot-remove
paths.

The architecture fixes depend on the common MM change in patch 1, so
this remains a single series. I expect it to go through the MM tree,
with review or acks from the relevant architecture maintainers.

v3:
- Explain why pagetable_free() does not run the destructor twice.
- Add the x86 stable prerequisites noted by Jose A. Perez de Azpillaga.
- Collect Acked-by and Reviewed-by tags from reviewers.

v2: https://lore.kernel.org/20261010112457.49485-1-songmuchun@bytedance.com/
- Move the destructor decision from x86 into pagetable_free(), as
  suggested by David Hildenbrand.
- Use pagetable_free() for non-reserved RISC-V page-table pages and
  simplify reserved-page handling.
- Collect David Hildenbrand's Acked-by on the RISC-V PUD fix.
- Use pagetable_free() for arm64 intermediate page-table pages, as
  suggested by David Hildenbrand.
- Trim and update the commit messages, as requested by Dave Hansen.

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

Muchun Song (4):
  mm: fix missing page-table destructor in pagetable_free()
  riscv/mm: fix hotplug page-table destructor handling
  riscv/mm: fix missing destructor for hotplug PUD tables
  arm64/mm: fix destructor for unconstructed hotplug page tables

 arch/arm64/mm/mmu.c  |  3 +--
 arch/riscv/mm/init.c | 32 +++++++++++++-------------------
 include/linux/mm.h   | 37 ++++++++++++++++++++-----------------
 3 files changed, 34 insertions(+), 38 deletions(-)


base-commit: 26d7e34b4226709084461a07bf28d9066fa96d8c
-- 
2.54.0


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

end of thread, other threads:[~2026-10-27 17:06 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-23  6:34 [PATCH v3 0/4] mm: Fix page-table teardown during memory hot-remove Muchun Song
2026-10-23  6:34 ` [PATCH v3 1/4] mm: fix missing page-table destructor in pagetable_free() Muchun Song
2026-10-23 10:18   ` Anshuman Khandual
2026-10-23  6:34 ` [PATCH v3 2/4] riscv/mm: fix hotplug page-table destructor handling Muchun Song
2026-10-23  6:34 ` [PATCH v3 3/4] riscv/mm: fix missing destructor for hotplug PUD tables Muchun Song
2026-10-23  6:34 ` [PATCH v3 4/4] arm64/mm: fix destructor for unconstructed hotplug page tables Muchun Song
2026-10-23 10:18   ` Anshuman Khandual
2026-10-27 17:06   ` Catalin Marinas

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

all inboxes | Powered by JetHome®