Thread (1 message) 1 message, 1 author, 2026-03-20

Re: [PATCH v2 1/4] mm: bypass mmap_miss heuristic for VM_EXEC readahead

From: Kiryl Shutsemau <kas@kernel.org>
Date: 2026-03-20 14:26:54
Also in: linux-fsdevel, linux-mm, lkml

On Fri, Mar 20, 2026 at 06:58:51AM -0700, Usama Arif wrote:
quoted hunk
diff --git a/mm/filemap.c b/mm/filemap.c
index 6cd7974d4adab..7d89c6b384cc4 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -3331,7 +3331,7 @@ static struct file *do_sync_mmap_readahead(struct vm_fault *vmf)
 		}
 	}
 
-	if (!(vm_flags & VM_SEQ_READ)) {
+	if (!(vm_flags & (VM_SEQ_READ | VM_EXEC))) {
Strictly speaking the fact that the file mapped as executable doesn't
mean we are serving instruction fetch page fault.

FAULT_FLAG_INSTRUCTION would be the signal, but it is only provided by
handful of architectures.

VM_EXEC is good enough proxy.

Reviewed-by: Kiryl Shutsemau (Meta) <kas@kernel.org>

-- 
  Kiryl Shutsemau / Kirill A. Shutemov
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help