[PATCH 34/36] autonuma: make the AUTONUMA_SCAN_PMD_FLAG conditional to CONFIG_HAVE_ARCH_AUTONUMA_SCAN_PMD

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <aarcange@xxxxxxxxxx>
---
 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, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]