Re: [PATCH 1/3] mm: introduce VM_MAYBE_GUARD and make visible for guard regions
From: Randy Dunlap
Date: Wed Oct 29 2025 - 15:50:24 EST
On 10/29/25 9:50 AM, Lorenzo Stoakes wrote:
> diff --git a/mm/memory.c b/mm/memory.c
> index 4c3a7e09a159..a2c79ee43d68 100644
> --- a/mm/memory.c
> +++ b/mm/memory.c
> @@ -1478,6 +1478,10 @@ vma_needs_copy(struct vm_area_struct *dst_vma, struct vm_area_struct *src_vma)
> if (src_vma->anon_vma)
> return true;
>
> + /* Guard regions have momdified page tables that require copying. */
modified
> + if (src_vma->vm_flags & VM_MAYBE_GUARD)
> + return true;
> +
> /*
> * Don't copy ptes where a page fault will fill them correctly. Fork
> * becomes much lighter when there are big shared or private readonly
--
~Randy