Remove the sysfs entry /sys/kernel/mm/autonuma/knuma_scand/pmd and force the knuma_scand pmd mode off if CONFIG_HAVE_ARCH_AUTONUMA_SCAN_PMD is not set by the architecture.
Enable AutoNUMA for PPC64. Signed-off-by: Andrea Arcangeli <aarca...@redhat.com> --- arch/Kconfig | 3 +++ arch/powerpc/Kconfig | 6 ++++++ arch/x86/Kconfig | 1 + mm/autonuma.c | 9 ++++++++- 4 files changed, 18 insertions(+), 1 deletions(-) diff --git a/arch/Kconfig b/arch/Kconfig index ee3ed89..6f4f19f 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -284,4 +284,7 @@ config SECCOMP_FILTER config HAVE_ARCH_AUTONUMA bool +config HAVE_ARCH_AUTONUMA_SCAN_PMD + bool + source "kernel/gcov/Kconfig" diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index 352f416..73fa908 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -140,6 +140,12 @@ config PPC select GENERIC_STRNCPY_FROM_USER select GENERIC_STRNLEN_USER +# allow AutoNUMA only on PPC64 for now +config PPC_HAVE_ARCH_AUTONUMA + bool + default y if PPC64 + select HAVE_ARCH_AUTONUMA + config EARLY_PRINTK bool default y diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 4cbdfce..f24bff8 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -98,6 +98,7 @@ config X86 select GENERIC_STRNCPY_FROM_USER select GENERIC_STRNLEN_USER select HAVE_ARCH_AUTONUMA + select HAVE_ARCH_AUTONUMA_SCAN_PMD config INSTRUCTION_DECODER def_bool (KPROBES || PERF_EVENTS || UPROBES) diff --git a/mm/autonuma.c b/mm/autonuma.c index a4da3f3..4b7c744 100644 --- a/mm/autonuma.c +++ b/mm/autonuma.c @@ -25,7 +25,10 @@ unsigned long autonuma_flags __read_mostly = #ifdef CONFIG_AUTONUMA_DEFAULT_ENABLED |(1<<AUTONUMA_ENABLED_FLAG) #endif - |(0<<AUTONUMA_SCAN_PMD_FLAG); +#ifdef CONFIG_HAVE_ARCH_AUTONUMA_SCAN_PMD + |(1<<AUTONUMA_SCAN_PMD_FLAG) +#endif + ; static DEFINE_MUTEX(knumad_mm_mutex); @@ -1300,7 +1303,9 @@ static ssize_t NAME ## _store(struct kobject *kobj, \ static struct kobj_attribute NAME ## _attr = \ __ATTR(NAME, 0644, NAME ## _show, NAME ## _store); +#ifdef CONFIG_HAVE_ARCH_AUTONUMA_SCAN_PMD SYSFS_ENTRY(pmd, AUTONUMA_SCAN_PMD_FLAG); +#endif /* CONFIG_HAVE_ARCH_AUTONUMA_SCAN_PMD */ SYSFS_ENTRY(debug, AUTONUMA_DEBUG_FLAG); #ifdef CONFIG_DEBUG_VM SYSFS_ENTRY(load_balance_strict, AUTONUMA_SCHED_LOAD_BALANCE_STRICT_FLAG); @@ -1398,7 +1403,9 @@ static struct attribute *knuma_scand_attr[] = { &pages_to_scan_attr.attr, &pages_scanned_attr.attr, &full_scans_attr.attr, +#ifdef CONFIG_HAVE_ARCH_AUTONUMA_SCAN_PMD &pmd_attr.attr, +#endif NULL, }; static struct attribute_group knuma_scand_attr_group = { -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/