Skip to content

Commit d645fc0

Browse files
LiangChen77torvalds
authored andcommitted
mm: mempolicy: skip non-migratable VMAs when setting MPOL_MF_LAZY
MPOL_MF_LAZY is not visible from userspace since a720094 ("mm: mempolicy: Hide MPOL_NOOP and MPOL_MF_LAZY from userspace for now"), but it should still skip non-migratable VMAs such as VM_IO, VM_PFNMAP, and VM_HUGETLB VMAs, and avoid useless overhead of minor faults. Signed-off-by: Liang Chen <[email protected]> Signed-off-by: Gavin Guo <[email protected]> Acked-by: Rik van Riel <[email protected]> Cc: Mel Gorman <[email protected]> Cc: Andi Kleen <[email protected]> Cc: Vlastimil Babka <[email protected]> Cc: David Rientjes <[email protected]> Cc: Naoya Horiguchi <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent f16f091 commit d645fc0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

mm/mempolicy.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,8 @@ static int queue_pages_test_walk(unsigned long start, unsigned long end,
644644

645645
if (flags & MPOL_MF_LAZY) {
646646
/* Similar to task_numa_work, skip inaccessible VMAs */
647-
if (vma->vm_flags & (VM_READ | VM_EXEC | VM_WRITE))
647+
if (vma_migratable(vma) &&
648+
vma->vm_flags & (VM_READ | VM_EXEC | VM_WRITE))
648649
change_prot_numa(vma, start, endvma);
649650
return 1;
650651
}

0 commit comments

Comments
 (0)