Re: [PATCH v4 2/9] mm: add atomic VMA flags and set VM_MAYBE_GUARD as such

From: Lance Yang

Date: Thu Nov 20 2025 - 01:11:54 EST




On 2025/11/18 18:17, Lorenzo Stoakes wrote:
This patch adds the ability to atomically set VMA flags with only the mmap
read/VMA read lock held.

As this could be hugely problematic for VMA flags in general given that
all other accesses are non-atomic and serialised by the mmap/VMA locks, we
implement this with a strict allow-list - that is, only designated flags
are allowed to do this.

We make VM_MAYBE_GUARD one of these flags.

Signed-off-by: Lorenzo Stoakes <lorenzo.stoakes@xxxxxxxxxx>
Reviewed-by: Pedro Falcato <pfalcato@xxxxxxx>
Reviewed-by: Vlastimil Babka <vbabka@xxxxxxx>
---

LGTM! Feel free to add:

Reviewed-by: Lance Yang <lance.yang@xxxxxxxxx>