summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mm/filemap.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/mm/filemap.c b/mm/filemap.c
index 6bf0b540ef19..58d8ba867b52 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -3340,7 +3340,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))) {
/* Avoid banging the cache line if not needed */
mmap_miss = READ_ONCE(ra->mmap_miss);
if (mmap_miss < MMAP_LOTSAMISS * 10)
@@ -3435,12 +3435,12 @@ static struct file *do_async_mmap_readahead(struct vm_fault *vmf,
* times for a single folio and break the balance with mmap_miss
* increase in do_sync_mmap_readahead().
*
- * VM_SEQ_READ mappings skip the mmap_miss increment in
+ * VM_SEQ_READ and VM_EXEC mappings skip the mmap_miss increment in
* do_sync_mmap_readahead(), so skip the decrement here as well to
* keep the counter symmetric.
*/
if (likely(!folio_test_locked(folio)) &&
- !(vmf->vma->vm_flags & VM_SEQ_READ)) {
+ !(vmf->vma->vm_flags & (VM_SEQ_READ | VM_EXEC))) {
mmap_miss = READ_ONCE(ra->mmap_miss);
if (mmap_miss)
WRITE_ONCE(ra->mmap_miss, --mmap_miss);
@@ -3942,14 +3942,14 @@ vm_fault_t filemap_map_pages(struct vm_fault *vmf,
* Don't decrease mmap_miss in this scenario to make sure
* we can stop read-ahead.
*
- * VM_SEQ_READ mappings skip the mmap_miss increment in
- * do_sync_mmap_readahead(), so skip the decrement here as
- * well to keep the counter symmetric.
+ * VM_SEQ_READ and VM_EXEC mappings skip the mmap_miss
+ * increment in do_sync_mmap_readahead(), so skip the
+ * decrement here as well to keep the counter symmetric.
*/
if ((map_ret & VM_FAULT_NOPAGE) &&
!(vmf->flags & FAULT_FLAG_TRIED) &&
!folio_test_workingset(folio) &&
- !(vma->vm_flags & VM_SEQ_READ)) {
+ !(vma->vm_flags & (VM_SEQ_READ | VM_EXEC))) {
unsigned short mmap_miss;
mmap_miss = READ_ONCE(file->f_ra.mmap_miss);