Commit 5877231f646bbd6d1d545e7af83aaa6e6b746013
Committed by
Benjamin Herrenschmidt
1 parent
2c49195b6a
Exists in
master
and in
16 other branches
mm: Move change_prot_numa outside CONFIG_ARCH_USES_NUMA_PROT_NONE
change_prot_numa should work even if _PAGE_NUMA != _PAGE_PROTNONE. On archs like ppc64 that don't use _PAGE_PROTNONE and also have a separate page table outside linux pagetable, we just need to make sure that when calling change_prot_numa we flush the hardware page table entry so that next page access result in a numa fault. We still need to make sure we use the numa faulting logic only when CONFIG_NUMA_BALANCING is set. This implies the migrate-on-fault (Lazy migration) via mbind will only work if CONFIG_NUMA_BALANCING is set. Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Reviewed-by: Rik van Riel <riel@redhat.com> Acked-by: Mel Gorman <mgorman@suse.de> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Showing 2 changed files with 3 additions and 4 deletions Side-by-side Diff
include/linux/mm.h
mm/mempolicy.c
... | ... | @@ -613,7 +613,7 @@ |
613 | 613 | return 0; |
614 | 614 | } |
615 | 615 | |
616 | -#ifdef CONFIG_ARCH_USES_NUMA_PROT_NONE | |
616 | +#ifdef CONFIG_NUMA_BALANCING | |
617 | 617 | /* |
618 | 618 | * This is used to mark a range of virtual addresses to be inaccessible. |
619 | 619 | * These are later cleared by a NUMA hinting fault. Depending on these |
... | ... | @@ -627,7 +627,6 @@ |
627 | 627 | unsigned long addr, unsigned long end) |
628 | 628 | { |
629 | 629 | int nr_updated; |
630 | - BUILD_BUG_ON(_PAGE_NUMA != _PAGE_PROTNONE); | |
631 | 630 | |
632 | 631 | nr_updated = change_protection(vma, addr, end, vma->vm_page_prot, 0, 1); |
633 | 632 | if (nr_updated) |
... | ... | @@ -641,7 +640,7 @@ |
641 | 640 | { |
642 | 641 | return 0; |
643 | 642 | } |
644 | -#endif /* CONFIG_ARCH_USES_NUMA_PROT_NONE */ | |
643 | +#endif /* CONFIG_NUMA_BALANCING */ | |
645 | 644 | |
646 | 645 | /* |
647 | 646 | * Walk through page tables and collect pages to be migrated. |