Skip to content

Commit 2c0346a

Browse files
Mel Gormantorvalds
Mel Gorman
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 <[email protected]> Acked-by: Rik van Riel <[email protected]> Acked-by: Hugh Dickins <[email protected]> Acked-by: Peter Zijlstra <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 0085d61 commit 2c0346a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

mm/mempolicy.c

+3-1
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)