Skip to content

Commit

Permalink
mm/mempolicy.c: skip VM_HUGETLB and VM_MIXEDMAP VMA for lazy mbind
Browse files Browse the repository at this point in the history
VM_HUGETLB and VM_MIXEDMAP vma needs to be excluded to avoid compound
pages being marked for migration and unexpected COWs when handling
hugetlb fault.

Thanks to Naoya Horiguchi for reminding me on these checks.

Signed-off-by: Liang Chen <[email protected]>
Signed-off-by: Gavin Guo <[email protected]>
Suggested-by: Naoya Horiguchi <[email protected]>
Acked-by: David Rientjes <[email protected]>
Cc: SeongJae Park <[email protected]>
Cc: Rik van Riel <[email protected]>
Cc: Mel Gorman <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
LiangChen77 authored and torvalds committed Mar 15, 2016
1 parent 0b94f17 commit 4355c01
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mm/mempolicy.c
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,9 @@ static int queue_pages_test_walk(unsigned long start, unsigned long end,

if (flags & MPOL_MF_LAZY) {
/* Similar to task_numa_work, skip inaccessible VMAs */
if (vma->vm_flags & (VM_READ | VM_EXEC | VM_WRITE))
if (!is_vm_hugetlb_page(vma) &&
(vma->vm_flags & (VM_READ | VM_EXEC | VM_WRITE)) &&
!(vma->vm_flags & VM_MIXEDMAP))
change_prot_numa(vma, start, endvma);
return 1;
}
Expand Down

0 comments on commit 4355c01

Please sign in to comment.