Skip to content

Commit 2c0346a

Browse files
Mel Gormantorvalds
authored andcommitted
mm: mempolicy: skip inaccessible VMAs when setting MPOL_MF_LAZY
PROT_NUMA VMAs are skipped to avoid problems distinguishing between present, prot_none and special entries. MPOL_MF_LAZY is not visible from userspace since commit a720094 ("mm: mempolicy: Hide MPOL_NOOP and MPOL_MF_LAZY from userspace for now") but it should still skip VMAs the same way task_numa_work does. Signed-off-by: Mel Gorman <mgorman@suse.de> Acked-by: Rik van Riel <riel@redhat.com> Acked-by: Hugh Dickins <hughd@google.com> Acked-by: Peter Zijlstra <peterz@infradead.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 0085d61 commit 2c0346a

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎mm/mempolicy.c‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,9 @@ queue_pages_range(struct mm_struct *mm, unsigned long start, unsigned long end,
681681
}
682682

683683
if (flags & MPOL_MF_LAZY) {
684-
change_prot_numa(vma, start, endvma);
684+
/* Similar to task_numa_work, skip inaccessible VMAs */
685+
if (vma->vm_flags & (VM_READ | VM_EXEC | VM_WRITE))
686+
change_prot_numa(vma, start, endvma);
685687
goto next;
686688
}
687689

0 commit comments

Comments
 (0)