Skip to content
This repository has been archived by the owner on Aug 27, 2022. It is now read-only.

Commit

Permalink
[PATCH] Configurable NODES_SHIFT
Browse files Browse the repository at this point in the history
Current implementations define NODES_SHIFT in include/asm-xxx/numnodes.h for
each arch.  Its definition is sometimes configurable.  Indeed, ia64 defines 5
NODES_SHIFT values in the current git tree.  But it looks a bit messy.

SGI-SN2(ia64) system requires 1024 nodes, and the number of nodes already has
been changeable by config.  Suitable node's number may be changed in the
future even if it is other architecture.  So, I wrote configurable node's
number.

This patch set defines just default value for each arch which needs multi
nodes except ia64.  But, it is easy to change to configurable if necessary.

On ia64 the number of nodes can be already configured in generic ia64 and SN2
config.  But, NODES_SHIFT is defined for DIG64 and HP'S machine too.  So, I
changed it so that all platforms can be configured via CONFIG_NODES_SHIFT.  It
would be simpler.

See also: http://marc.theaimsgroup.com/?l=linux-kernel&m=114358010523896&w=2

Signed-off-by: Yasunori Goto <y-goto@jp.fujitsu.com>
Cc: Hirokazu Takata <takata@linux-m32r.org>
Cc: "Luck, Tony" <tony.luck@intel.com>
Cc: Andi Kleen <ak@muc.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Kyle McMartin <kyle@mcmartin.ca>
Cc: Russell King <rmk@arm.linux.org.uk>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Jack Steiner <steiner@sgi.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Yasunori Goto authored and Linus Torvalds committed Apr 11, 2006
1 parent 653edba commit c80d79d
Show file tree
Hide file tree
Showing 23 changed files with 60 additions and 143 deletions.
5 changes: 5 additions & 0 deletions arch/alpha/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,11 @@ config NUMA
Access). This option is for configuring high-end multiprocessor
server machines. If in doubt, say N.

config NODES_SHIFT
int
default "7"
depends on NEED_MULTIPLE_NODES

# LARGE_VMALLOC is racy, if you *really* need it then fix it first
config ALPHA_LARGE_VMALLOC
bool
Expand Down
6 changes: 6 additions & 0 deletions arch/arm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,12 @@ config ARCH_DISCONTIGMEM_ENABLE
or have huge holes in the physical address space for other reasons.
See <file:Documentation/vm/numa> for more.

config NODES_SHIFT
int
default "4" if ARCH_LH7A40X
default "2"
depends on NEED_MULTIPLE_NODES

source "mm/Kconfig"

config LEDS
Expand Down
6 changes: 6 additions & 0 deletions arch/i386/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,12 @@ config NUMA
comment "NUMA (Summit) requires SMP, 64GB highmem support, ACPI"
depends on X86_SUMMIT && (!HIGHMEM64G || !ACPI)

config NODES_SHIFT
int
default "4" if X86_NUMAQ
default "3"
depends on NEED_MULTIPLE_NODES

config HAVE_ARCH_BOOTMEM_NODE
bool
depends on NUMA
Expand Down
19 changes: 10 additions & 9 deletions arch/ia64/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -260,15 +260,6 @@ config NR_CPUS
than 64 will cause the use of a CPU mask array, causing a small
performance hit.

config IA64_NR_NODES
int "Maximum number of NODEs (256-1024)" if (IA64_SGI_SN2 || IA64_GENERIC)
range 256 1024
depends on IA64_SGI_SN2 || IA64_GENERIC
default "256"
help
This option specifies the maximum number of nodes in your SSI system.
If in doubt, use the default.

config HOTPLUG_CPU
bool "Support for hot-pluggable CPUs (EXPERIMENTAL)"
depends on SMP && EXPERIMENTAL
Expand Down Expand Up @@ -352,6 +343,16 @@ config NUMA
Access). This option is for configuring high-end multiprocessor
server systems. If in doubt, say N.

config NODES_SHIFT
int "Max num nodes shift(3-10)"
range 3 10
default "8"
depends on NEED_MULTIPLE_NODES
help
This option specifies the maximum number of nodes in your SSI system.
MAX_NUMNODES will be 2^(This value).
If in doubt, use the default.

# VIRTUAL_MEM_MAP and FLAT_NODE_MEM_MAP are functionally equivalent.
# VIRTUAL_MEM_MAP has been retained for historical reasons.
config VIRTUAL_MEM_MAP
Expand Down
5 changes: 5 additions & 0 deletions arch/m32r/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,11 @@ config NUMA
depends on SMP && BROKEN
default n

config NODES_SHIFT
int
default "1"
depends on NEED_MULTIPLE_NODES

# turning this on wastes a bunch of space.
# Summit needs it only when NUMA is on
config BOOT_IOREMAP
Expand Down
5 changes: 5 additions & 0 deletions arch/mips/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1590,6 +1590,11 @@ config ARCH_FLATMEM_ENABLE
def_bool y
depends on !NUMA

config NODES_SHIFT
int
default "6"
depends on NEED_MULTIPLE_NODES

source "mm/Kconfig"

config SMP
Expand Down
5 changes: 5 additions & 0 deletions arch/parisc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,11 @@ config ARCH_DISCONTIGMEM_DEFAULT
def_bool y
depends on ARCH_DISCONTIGMEM_ENABLE

config NODES_SHIFT
int
default "3"
depends on NEED_MULTIPLE_NODES

source "kernel/Kconfig.preempt"
source "kernel/Kconfig.hz"
source "mm/Kconfig"
Expand Down
5 changes: 5 additions & 0 deletions arch/powerpc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -649,6 +649,11 @@ config NUMA
depends on PPC64
default y if SMP && PPC_PSERIES

config NODES_SHIFT
int
default "4"
depends on NEED_MULTIPLE_NODES

config ARCH_SELECT_MEMORY_MODEL
def_bool y
depends on PPC64
Expand Down
5 changes: 5 additions & 0 deletions arch/sh/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,11 @@ config CPU_HAS_SR_RB
See <file:Documentation/sh/register-banks.txt> for further
information on SR.RB and register banking in the kernel in general.

config NODES_SHIFT
int
default "1"
depends on NEED_MULTIPLE_NODES

endmenu

menu "Boot options"
Expand Down
5 changes: 5 additions & 0 deletions arch/x86_64/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,11 @@ config K8_NUMA
Northbridge of Opteron. It is recommended to use X86_64_ACPI_NUMA
instead, which also takes priority if both are compiled in.

config NODES_SHIFT
int
default "6"
depends on NEED_MULTIPLE_NODES

# Dummy CONFIG option to select ACPI_NUMA from drivers/acpi/Kconfig.

config X86_64_ACPI_NUMA
Expand Down
7 changes: 0 additions & 7 deletions include/asm-alpha/numnodes.h

This file was deleted.

2 changes: 0 additions & 2 deletions include/asm-arm/arch-lh7a40x/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@

#ifdef CONFIG_DISCONTIGMEM

#define NODES_SHIFT 4 /* Up to 16 nodes */

/*
* Given a kernel address, find the home node of the underlying memory.
*/
Expand Down
26 changes: 0 additions & 26 deletions include/asm-arm/numnodes.h

This file was deleted.

18 changes: 0 additions & 18 deletions include/asm-i386/numnodes.h

This file was deleted.

20 changes: 0 additions & 20 deletions include/asm-ia64/numnodes.h

This file was deleted.

15 changes: 0 additions & 15 deletions include/asm-m32r/numnodes.h

This file was deleted.

7 changes: 0 additions & 7 deletions include/asm-mips/numnodes.h

This file was deleted.

7 changes: 0 additions & 7 deletions include/asm-parisc/numnodes.h

This file was deleted.

9 changes: 0 additions & 9 deletions include/asm-powerpc/numnodes.h

This file was deleted.

7 changes: 0 additions & 7 deletions include/asm-sh/numnodes.h

This file was deleted.

1 change: 0 additions & 1 deletion include/asm-x86_64/numa.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#define _ASM_X8664_NUMA_H 1

#include <linux/nodemask.h>
#include <asm/numnodes.h>

struct bootnode {
u64 start,end;
Expand Down
10 changes: 0 additions & 10 deletions include/asm-x86_64/numnodes.h

This file was deleted.

8 changes: 3 additions & 5 deletions include/linux/numa.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@

#include <linux/config.h>

#ifndef CONFIG_FLATMEM
#include <asm/numnodes.h>
#endif

#ifndef NODES_SHIFT
#ifdef CONFIG_NODES_SHIFT
#define NODES_SHIFT CONFIG_NODES_SHIFT
#else
#define NODES_SHIFT 0
#endif

Expand Down

0 comments on commit c80d79d

Please sign in to comment.