linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] mm: perform guard region install/remove under VMA lock
@ 2025-11-09 11:16 Lorenzo Stoakes
  2025-11-09 11:16 ` [PATCH 1/2] mm: rename walk_page_range_mm() Lorenzo Stoakes
  2025-11-09 11:16 ` [PATCH 2/2] mm/madvise: allow guard page install/remove under VMA lock Lorenzo Stoakes
  0 siblings, 2 replies; 7+ messages in thread
From: Lorenzo Stoakes @ 2025-11-09 11:16 UTC (permalink / raw)
  To: Andrew Morton
  Cc: David Hildenbrand, Liam R . Howlett, Vlastimil Babka,
	Mike Rapoport, Suren Baghdasaryan, Michal Hocko, Jann Horn,
	linux-mm, linux-kernel

There is no reason why can't perform guard region operations under the VMA
lock, as long we take proper precautions to ensure that we do so in a safe
manner.

This is fine, as VMA lock acquisition is always best-effort, so if we are
unable to do so, we can simply fall back to using the mmap read lock.

Doing so will reduce mmap lock contention for callers performing guard
region operations and help establish a precedent of trying to use the VMA
lock where possible.

As part of this change we perform a trivial rename of page walk functions
which bypass safety checks (i.e. whether or not mm_walk_ops->install_pte is
specified) in order that we can keep naming consistent with the mm walk.

This is because we need to expose a VMA-specific walk that still allows us
to install PTE entries.

Lorenzo Stoakes (2):
  mm: rename walk_page_range_mm()
  mm/madvise: allow guard page install/remove under VMA lock

 mm/internal.h |   5 ++-
 mm/madvise.c  | 110 ++++++++++++++++++++++++++++++++++++--------------
 mm/pagewalk.c |  25 +++++++-----
 3 files changed, 99 insertions(+), 41 deletions(-)

--
2.51.0


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

end of thread, other threads:[~2025-11-10 16:30 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-11-09 11:16 [PATCH 0/2] mm: perform guard region install/remove under VMA lock Lorenzo Stoakes
2025-11-09 11:16 ` [PATCH 1/2] mm: rename walk_page_range_mm() Lorenzo Stoakes
2025-11-10 15:48   ` David Hildenbrand (Red Hat)
2025-11-10 16:28     ` Lorenzo Stoakes
2025-11-09 11:16 ` [PATCH 2/2] mm/madvise: allow guard page install/remove under VMA lock Lorenzo Stoakes
2025-11-10 15:44   ` David Hildenbrand (Red Hat)
2025-11-10 16:29     ` Lorenzo Stoakes

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