Commit 2c0346a36cc8ac6cb85ab585964590974c84bdf0
Committed by
Linus Torvalds
1 parent
0085d61fe0
Exists in
ti-lsk-linux-4.1.y
and in
10 other branches
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 a720094ded8c ("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>
Showing 1 changed file with 3 additions and 1 deletions Side-by-side Diff
mm/mempolicy.c
... | ... | @@ -681,7 +681,9 @@ |
681 | 681 | } |
682 | 682 | |
683 | 683 | 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); | |
685 | 687 | goto next; |
686 | 688 | } |
687 | 689 |