Commit 74c8f65c authored by Andi Kleen's avatar Andi Kleen Committed by Linus Torvalds

[PATCH] x86_64: Allow to configure more CPUs and nodes.

Allow to configure more CPUs and nodes.

With clustered mode and AMD's big flat APIC mode there is no reason anymore to
limit the max number of CPUs to 8.  Increase the limit to 256 for now, which
is the current APIC limit. 

Untested for now.

Also increase the max number of nodes to 64.  Remove the MAXNODE define and
replace it with MAX_NUMNODES everywhere or the constant if the hardware limits
the number of nodes.

Also remove some obsolete comments.
Signed-off-by: default avatarAndi Kleen <ak@suse.de>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent bd586bc0
...@@ -289,17 +289,15 @@ config HAVE_DEC_LOCK ...@@ -289,17 +289,15 @@ config HAVE_DEC_LOCK
depends on SMP depends on SMP
default y default y
# actually 64 maximum, but you need to fix the APIC code first
# to use clustered mode or whatever your big iron needs
config NR_CPUS config NR_CPUS
int "Maximum number of CPUs (2-8)" int "Maximum number of CPUs (2-256)"
range 2 8 range 2 256
depends on SMP depends on SMP
default "8" default "8"
help help
This allows you to specify the maximum number of CPUs which this This allows you to specify the maximum number of CPUs which this
kernel will support. The maximum supported value is 32 and the kernel will support. Current maximum is 256 CPUs due to
minimum value which makes sense is 2. APIC addressing limits. Less depending on the hardware.
This is purely to save memory - each supported CPU requires This is purely to save memory - each supported CPU requires
memory in the static kernel configuration. memory in the static kernel configuration.
......
...@@ -43,7 +43,7 @@ static __init int find_northbridge(void) ...@@ -43,7 +43,7 @@ static __init int find_northbridge(void)
int __init k8_scan_nodes(unsigned long start, unsigned long end) int __init k8_scan_nodes(unsigned long start, unsigned long end)
{ {
unsigned long prevbase; unsigned long prevbase;
struct node nodes[MAXNODE]; struct node nodes[8];
int nodeid, i, nb; int nodeid, i, nb;
int found = 0; int found = 0;
u32 reg; u32 reg;
...@@ -149,7 +149,7 @@ int __init k8_scan_nodes(unsigned long start, unsigned long end) ...@@ -149,7 +149,7 @@ int __init k8_scan_nodes(unsigned long start, unsigned long end)
} }
printk(KERN_INFO "Using node hash shift of %d\n", memnode_shift); printk(KERN_INFO "Using node hash shift of %d\n", memnode_shift);
for (i = 0; i < MAXNODE; i++) { for (i = 0; i < 8; i++) {
if (nodes[i].start != nodes[i].end) { if (nodes[i].start != nodes[i].end) {
/* assume 1:1 NODE:CPU */ /* assume 1:1 NODE:CPU */
cpu_to_node[i] = i; cpu_to_node[i] = i;
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#define Dprintk(x...) #define Dprintk(x...)
#endif #endif
struct pglist_data *node_data[MAXNODE]; struct pglist_data *node_data[MAX_NUMNODES];
bootmem_data_t plat_node_bdata[MAX_NUMNODES]; bootmem_data_t plat_node_bdata[MAX_NUMNODES];
int memnode_shift; int memnode_shift;
...@@ -30,7 +30,7 @@ u8 memnodemap[NODEMAPSIZE]; ...@@ -30,7 +30,7 @@ u8 memnodemap[NODEMAPSIZE];
#define NUMA_NO_NODE 0xff #define NUMA_NO_NODE 0xff
unsigned char cpu_to_node[NR_CPUS] = { [0 ... NR_CPUS-1] = NUMA_NO_NODE }; unsigned char cpu_to_node[NR_CPUS] = { [0 ... NR_CPUS-1] = NUMA_NO_NODE };
cpumask_t node_to_cpumask[MAXNODE]; cpumask_t node_to_cpumask[MAX_NUMNODES];
int numa_off __initdata; int numa_off __initdata;
...@@ -152,7 +152,7 @@ void __init numa_init_array(void) ...@@ -152,7 +152,7 @@ void __init numa_init_array(void)
CPUs, as the number of CPUs is not known yet. CPUs, as the number of CPUs is not known yet.
We round robin the existing nodes. */ We round robin the existing nodes. */
rr = 0; rr = 0;
for (i = 0; i < MAXNODE; i++) { for (i = 0; i < MAX_NUMNODES; i++) {
if (node_online(i)) if (node_online(i))
continue; continue;
if (cpu_to_node[i] != NUMA_NO_NODE) if (cpu_to_node[i] != NUMA_NO_NODE)
...@@ -175,7 +175,7 @@ int numa_fake __initdata = 0; ...@@ -175,7 +175,7 @@ int numa_fake __initdata = 0;
static int numa_emulation(unsigned long start_pfn, unsigned long end_pfn) static int numa_emulation(unsigned long start_pfn, unsigned long end_pfn)
{ {
int i; int i;
struct node nodes[MAXNODE]; struct node nodes[MAX_NUMNODES];
unsigned long sz = ((end_pfn - start_pfn)<<PAGE_SHIFT) / numa_fake; unsigned long sz = ((end_pfn - start_pfn)<<PAGE_SHIFT) / numa_fake;
/* Kludge needed for the hash function */ /* Kludge needed for the hash function */
......
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
#include <asm/smp.h> #include <asm/smp.h>
#define MAXNODE 8
#define NODEMAPSIZE 0xff #define NODEMAPSIZE 0xff
/* Simple perfect hash to map physical addresses to node numbers */ /* Simple perfect hash to map physical addresses to node numbers */
......
...@@ -2,9 +2,7 @@ ...@@ -2,9 +2,7 @@
#define _ASM_X8664_NUMA_H 1 #define _ASM_X8664_NUMA_H 1
#include <linux/nodemask.h> #include <linux/nodemask.h>
#include <asm/numnodes.h>
#define MAXNODE 8
#define NODEMASK 0xff
struct node { struct node {
u64 start,end; u64 start,end;
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
#include <linux/config.h> #include <linux/config.h>
/* Max 8 Nodes - APIC limit currently */ #define NODES_SHIFT 6
#define NODES_SHIFT 3
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment