Thread (28 messages) 28 messages, 5 authors, 2025-11-06

Re: [PATCH 1/3] mm: introduce VM_MAYBE_GUARD and make visible for guard regions

From: Randy Dunlap <hidden>
Date: 2025-10-29 19:50:24
Also in: linux-doc, linux-fsdevel, linux-kselftest, linux-mm, lkml

On 10/29/25 9:50 AM, Lorenzo Stoakes wrote:
quoted hunk ↗ jump to hunk
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help