summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2003-10-04 21:01:50 -0700
committerLinus Torvalds <torvalds@home.osdl.org>2003-10-04 21:01:50 -0700
commitc72da22fc150508340eea30c261d645bdac11b59 (patch)
tree6ac6046ead523b3be5c47c0e197406d60e680788 /include
parent96fcef0a0cf876713d6acc94751fa674edc66e16 (diff)
[PATCH] Clean up MAX_NR_NODES/NUMNODES/etc. [1/5]
From: Matthew Dobson <colpatch@us.ibm.com> This starts a series of cleanups against the way in which the various architectures specify the number of nodes and memory zones. We end up supporting up to 1024 memory zones on ia64, which is a recent requirement. Has been tested on ia32, ia64 (UMA), ppa64 (UMA) and NUMAQ. Make sure MAX_NUMNODES is defined in one and only one place. Remove superfluous definitions. Instead of defining MAX_NUMNODES in asm/numnodes.h, we define NODES_SHIFT there. Then in linux/mmzone.h we turn that NODES_SHIFT value into MAX_NUMNODES.
Diffstat (limited to 'include')
-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
8 files changed, 18 insertions, 17 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