Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/3] mm: don't allocate page tables with the folio locked
@ 2026-12-01 11:53 Jose A. Perez de Azpillaga
  2026-12-01 11:53 ` [PATCH v3 1/3] mm/memory: allocate the deposit page table with NOFS in do_set_pmd() Jose A. Perez de Azpillaga
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Jose A. Perez de Azpillaga @ 2026-12-01 11:53 UTC (permalink / raw)
  To: David Hildenbrand, Zi Yan, Andrew Morton, Zach O'Keefe,
	Hugh Dickins, Lorenzo Stoakes, Baolin Wang
  Cc: Liam R. Howlett, Nico Pache, Ryan Roberts, Dev Jain, Barry Song,
	Lance Yang, Usama Arif, Kiryl Shutsemau, Vlastimil Babka,
	Mike Rapoport, Michal Hocko, linux-mm, Matthew Wilcox, Jan Kara,
	Johannes Weiner, Rik van Riel, Song Liu, linux-fsdevel,
	Jose A. Perez de Azpillaga

David asked for the remaining places that allocate with __GFP_FS while
holding a folio lock [1]. The fault path and khugepaged still allocate
page tables that way.

Patch 1 allocates the deposit table in do_set_pmd() in a NOFS scope.
Patch 2 does the same for the tables set_huge_pmd() allocates.
Patch 3 makes finish_fault() retry the fault instead of allocating when
the page table went away after __do_fault() checked the PMD.

Tested on x86_64 and on ppc64le with the hash MMU in QEMU.

[1] https://lore.kernel.org/66e5f9e3-17d4-4635-8919-c67ed562f9f0@kernel.org

Changes in v3:
- 1/3, 2/3: rename nofs_flags to flags, one-line comments (Lorenzo)
- 3/3: new finish_fault() comment, best-effort note at the
  __do_fault() preallocation, NOPAGE retry in the changelog (Lorenzo)
- shorter changelogs, memcg v1 example only in 1/3 (Lorenzo)
- collect tags

Changes in v2:
- use NOFS in do_set_pmd() and set_huge_pmd() instead of preallocating
  in khugepaged and dropping the allocation from do_set_pmd() (David)
- finish_fault(): return VM_FAULT_NOPAGE after trying do_set_pmd()
  (David)
- drop patch 4
- rebase on mm/core.git for-next

v2: https://lore.kernel.org/20261127091344.113688-1-azpijr@gmail.com
v1: https://lore.kernel.org/20261125100058.15200-1-azpijr@gmail.com

Jose A. Perez de Azpillaga (3):
  mm/memory: allocate the deposit page table with NOFS in do_set_pmd()
  mm/khugepaged: allocate page tables with NOFS in set_huge_pmd()
  mm/memory: don't allocate in finish_fault() with the folio locked

 mm/khugepaged.c | 13 +++++++------
 mm/memory.c     | 19 +++++++++++++++----
 2 files changed, 22 insertions(+), 10 deletions(-)


base-commit: 89b4b2b15b2063e1bf593e609c3c63313b7ff160
-- 
2.56.1



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

end of thread, other threads:[~2026-12-01 11:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-01 11:53 [PATCH v3 0/3] mm: don't allocate page tables with the folio locked Jose A. Perez de Azpillaga
2026-12-01 11:53 ` [PATCH v3 1/3] mm/memory: allocate the deposit page table with NOFS in do_set_pmd() Jose A. Perez de Azpillaga
2026-12-01 11:53 ` [PATCH v3 2/3] mm/khugepaged: allocate page tables with NOFS in set_huge_pmd() Jose A. Perez de Azpillaga
2026-12-01 11:53 ` [PATCH v3 3/3] mm/memory: don't allocate in finish_fault() with the folio locked Jose A. Perez de Azpillaga
2026-12-01 11:56   ` Lorenzo Stoakes (ARM)

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