From: Mel Gorman Date: Thu, 9 Oct 2014 22:29:36 +0000 (-0700) Subject: mm: mempolicy: skip inaccessible VMAs when setting MPOL_MF_LAZY X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=2c0346a36cc8ac6cb85ab585964590974c84bdf0;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git 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 Acked-by: Rik van Riel Acked-by: Hugh Dickins Acked-by: Peter Zijlstra Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/mempolicy.c b/mm/mempolicy.c index 008fb32936eb..e58725aff7e9 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c @@ -681,7 +681,9 @@ queue_pages_range(struct mm_struct *mm, unsigned long start, unsigned long end, } if (flags & MPOL_MF_LAZY) { - change_prot_numa(vma, start, endvma); + /* Similar to task_numa_work, skip inaccessible VMAs */ + if (vma->vm_flags & (VM_READ | VM_EXEC | VM_WRITE)) + change_prot_numa(vma, start, endvma); goto next; }