From: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: David Hildenbrand <david@kernel.org>,
"Liam R . Howlett" <Liam.Howlett@oracle.com>,
Vlastimil Babka <vbabka@suse.cz>, Mike Rapoport <rppt@kernel.org>,
Suren Baghdasaryan <surenb@google.com>,
Michal Hocko <mhocko@suse.com>, Jann Horn <jannh@google.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: [PATCH 0/2] mm: perform guard region install/remove under VMA lock
Date: Sun, 9 Nov 2025 11:16:05 +0000 [thread overview]
Message-ID: <cover.1762686301.git.lorenzo.stoakes@oracle.com> (raw)
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
next reply other threads:[~2025-11-09 11:16 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-09 11:16 Lorenzo Stoakes [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cover.1762686301.git.lorenzo.stoakes@oracle.com \
--to=lorenzo.stoakes@oracle.com \
--cc=Liam.Howlett@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=david@kernel.org \
--cc=jannh@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.com \
--cc=rppt@kernel.org \
--cc=surenb@google.com \
--cc=vbabka@suse.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox