summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/asm-alpha/numnodes.h3
-rw-r--r--include/asm-i386/numaq.h1
-rw-r--r--include/asm-i386/numnodes.h14
-rw-r--r--include/asm-i386/srat.h1
-rw-r--r--include/asm-ppc64/numnodes.h3
-rw-r--r--include/asm-x86_64/mmzone.h1
-rw-r--r--include/asm-x86_64/numnodes.h7
-rw-r--r--include/linux/mmzone.h5
-rw-r--r--mm/slab.c2
9 files changed, 19 insertions, 18 deletions
diff --git a/include/asm-alpha/numnodes.h b/include/asm-alpha/numnodes.h
index 3c370ca3aaa6..cd425827e4f3 100644
--- a/include/asm-alpha/numnodes.h
+++ b/include/asm-alpha/numnodes.h
@@ -1,6 +1,7 @@
#ifndef _ASM_MAX_NUMNODES_H
#define _ASM_MAX_NUMNODES_H
-#define MAX_NUMNODES 128 /* Marvel */
+/* Max 128 Nodes - Marvel */
+#define NODES_SHIFT 7
#endif /* _ASM_MAX_NUMNODES_H */
diff --git a/include/asm-i386/numaq.h b/include/asm-i386/numaq.h
index 13eb04501378..38f710dc37f2 100644
--- a/include/asm-i386/numaq.h
+++ b/include/asm-i386/numaq.h
@@ -28,7 +28,6 @@
#ifdef CONFIG_X86_NUMAQ
-#define MAX_NUMNODES 16
extern int get_memcfg_numaq(void);
/*
diff --git a/include/asm-i386/numnodes.h b/include/asm-i386/numnodes.h
index d77cbdcda572..a61f38c8176f 100644
--- a/include/asm-i386/numnodes.h
+++ b/include/asm-i386/numnodes.h
@@ -4,11 +4,15 @@
#include <linux/config.h>
#ifdef CONFIG_X86_NUMAQ
-#include <asm/numaq.h>
-#elif CONFIG_ACPI_SRAT
-#include <asm/srat.h>
-#else
-#define MAX_NUMNODES 1
+
+/* Max 16 Nodes */
+#define NODES_SHIFT 4
+
+#elif defined(CONFIG_ACPI_SRAT)
+
+/* Max 8 Nodes */
+#define NODES_SHIFT 3
+
#endif /* CONFIG_X86_NUMAQ */
#endif /* _ASM_MAX_NUMNODES_H */
diff --git a/include/asm-i386/srat.h b/include/asm-i386/srat.h
index 13563f45870e..165ab4bdc02b 100644
--- a/include/asm-i386/srat.h
+++ b/include/asm-i386/srat.h
@@ -31,7 +31,6 @@
#error CONFIG_ACPI_SRAT not defined, and srat.h header has been included
#endif
-#define MAX_NUMNODES 8
extern int get_memcfg_from_srat(void);
extern unsigned long *get_zholes_size(int);
diff --git a/include/asm-ppc64/numnodes.h b/include/asm-ppc64/numnodes.h
index 7c85cfe9ecdd..75ae0b906708 100644
--- a/include/asm-ppc64/numnodes.h
+++ b/include/asm-ppc64/numnodes.h
@@ -1,6 +1,7 @@
#ifndef _ASM_MAX_NUMNODES_H
#define _ASM_MAX_NUMNODES_H
-#define MAX_NUMNODES 16
+/* Max 16 Nodes */
+#define NODES_SHIFT 4
#endif /* _ASM_MAX_NUMNODES_H */
diff --git a/include/asm-x86_64/mmzone.h b/include/asm-x86_64/mmzone.h
index 398c530270c2..1f8ec0b0f10f 100644
--- a/include/asm-x86_64/mmzone.h
+++ b/include/asm-x86_64/mmzone.h
@@ -10,7 +10,6 @@
#define VIRTUAL_BUG_ON(x)
-#include <asm/numnodes.h>
#include <asm/smp.h>
#define MAXNODE 8
diff --git a/include/asm-x86_64/numnodes.h b/include/asm-x86_64/numnodes.h
index 898bf89e1fdb..336011c3d3fd 100644
--- a/include/asm-x86_64/numnodes.h
+++ b/include/asm-x86_64/numnodes.h
@@ -3,10 +3,7 @@
#include <linux/config.h>
-#ifdef CONFIG_DISCONTIGMEM
-#define MAX_NUMNODES 8 /* APIC limit currently */
-#else
-#define MAX_NUMNODES 1
-#endif
+/* Max 8 Nodes - APIC limit currently */
+#define NODES_SHIFT 3
#endif
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index c66551a52d2a..5dcd62c5a9d6 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -14,9 +14,10 @@
#ifdef CONFIG_DISCONTIGMEM
#include <asm/numnodes.h>
#endif
-#ifndef MAX_NUMNODES
-#define MAX_NUMNODES 1
+#ifndef NODES_SHIFT
+#define NODES_SHIFT 0
#endif
+#define MAX_NUMNODES (1 << NODES_SHIFT)
/* Free memory management - zoned buddy allocator. */
#ifndef CONFIG_FORCE_MAX_ZONEORDER
diff --git a/mm/slab.c b/mm/slab.c
index 9b72c324d8c4..76c95b542be6 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -250,7 +250,7 @@ struct kmem_cache_s {
unsigned int limit;
/* 2) touched by every alloc & free from the backend */
struct kmem_list3 lists;
- /* NUMA: kmem_3list_t *nodelists[NR_NODES] */
+ /* NUMA: kmem_3list_t *nodelists[MAX_NUMNODES] */
unsigned int objsize;
unsigned int flags; /* constant flags */
unsigned int num; /* # of objs per slab */