Lucid SRU, CONFIG_NR_CPUS=256, LP706058

Brad Figg brad.figg at canonical.com
Fri Jan 21 20:49:25 UTC 2011


On 01/21/2011 12:30 PM, Tim Gardner wrote:
> The following changes since commit b09a4b6f2843b58a420fa6b75c991c1ed5defe92:
>    Greg Kroah-Hartman (1):
>          Linux 2.6.32.28
>
> are available in the git repository at:
>
>    git://kernel.ubuntu.com/rtg/ubuntu-lucid.git nr_cpus_256_lp706058
>
> Tim Gardner (1):
>        UBUNTU: [Config] Set CONFIG_NR_CPUS=256 for amd64 server
>
>   debian.master/config/amd64/config.common.amd64    |    1 -
>   debian.master/config/amd64/config.flavour.generic |    1 +
>   debian.master/config/amd64/config.flavour.preempt |    1 +
>   debian.master/config/amd64/config.flavour.server  |    1 +
>   4 files changed, 3 insertions(+), 1 deletions(-)
>
>  From 5d57615ee98ce183935a373c5750b14c32f2d877 Mon Sep 17 00:00:00 2001
> From: Tim Gardner<tim.gardner at canonical.com>
> Date: Fri, 21 Jan 2011 13:05:17 -0700
> Subject: [PATCH] UBUNTU: [Config] Set CONFIG_NR_CPUS=256 for amd64 server
>
> BugLink: http://bugs.launchpad.net/bugs/706058
>
> The CPU hotplug subsytem allocates memory using the per-cpu mechanism. Enough
> memory is pre-defined by CONFIG_NR_CPUS to accommodate the maximum number of
> CPUs that can be online. This value is discovered at boot time and is used to
> trim the actual memory allocated to the real number of CPUs. In effect,
> CONFIG_NR_CPUS has little impact on memory consumption except for these 9 vairables:
>
> kernel/cpu.c:static DECLARE_BITMAP(cpu_possible_bits, CONFIG_NR_CPUS) __read_mostly
> kernel/cpu.c:static DECLARE_BITMAP(cpu_possible_bits, CONFIG_NR_CPUS) __read_mostly;
> kernel/cpu.c:static DECLARE_BITMAP(cpu_online_bits, CONFIG_NR_CPUS) __read_mostly;
> kernel/cpu.c:static DECLARE_BITMAP(cpu_present_bits, CONFIG_NR_CPUS) __read_mostly;
> kernel/cpu.c:static DECLARE_BITMAP(cpu_active_bits, CONFIG_NR_CPUS) __read_mostly;
> kernel/sched.c: DECLARE_BITMAP(cpus, CONFIG_NR_CPUS);
> kernel/sched.c: DECLARE_BITMAP(span, CONFIG_NR_CPUS);
> kernel/sched.c: static DECLARE_BITMAP(tmpmask, CONFIG_NR_CPUS);
> mm/slub.c:static DECLARE_BITMAP(kmem_cach_cpu_free_init_once, CONFIG_NR_CPUS);
>
> The increase in memory size of these variables is negligible since they are bit
> map structures. For example, increasing from 64 to 256 only adds 24 bytes per
> variable.
>
> Signed-off-by: Tim Gardner<tim.gardner at canonical.com>
> ---
>   debian.master/config/amd64/config.common.amd64    |    1 -
>   debian.master/config/amd64/config.flavour.generic |    1 +
>   debian.master/config/amd64/config.flavour.preempt |    1 +
>   debian.master/config/amd64/config.flavour.server  |    1 +
>   4 files changed, 3 insertions(+), 1 deletions(-)
>
> diff --git a/debian.master/config/amd64/config.common.amd64 b/debian.master/config/amd64/config.common.amd64
> index f2352c8..cd2cc3a 100644
> --- a/debian.master/config/amd64/config.common.amd64
> +++ b/debian.master/config/amd64/config.common.amd64
> @@ -97,7 +97,6 @@ CONFIG_MTD_SLRAM=m
>   CONFIG_NDISWRAPPER=m
>   CONFIG_NFTL=m
>   CONFIG_NO_HZ=y
> -CONFIG_NR_CPUS=64
>   CONFIG_OUTPUT_FORMAT="elf64-x86-64"
>   CONFIG_PARPORT=m
>   CONFIG_PCCARD=m
> diff --git a/debian.master/config/amd64/config.flavour.generic b/debian.master/config/amd64/config.flavour.generic
> index 650ae59..89668a2 100644
> --- a/debian.master/config/amd64/config.flavour.generic
> +++ b/debian.master/config/amd64/config.flavour.generic
> @@ -8,6 +8,7 @@ CONFIG_HZ=100
>   CONFIG_HZ_100=y
>   # CONFIG_HZ_1000 is not set
>   # CONFIG_MEMORY_HOTPLUG is not set
> +CONFIG_NR_CPUS=64
>   # CONFIG_PREEMPT is not set
>   # CONFIG_PREEMPT_NONE is not set
>   CONFIG_PREEMPT_VOLUNTARY=y
> diff --git a/debian.master/config/amd64/config.flavour.preempt b/debian.master/config/amd64/config.flavour.preempt
> index becca6f..968f1eb 100644
> --- a/debian.master/config/amd64/config.flavour.preempt
> +++ b/debian.master/config/amd64/config.flavour.preempt
> @@ -8,6 +8,7 @@ CONFIG_HZ=1000
>   # CONFIG_HZ_100 is not set
>   CONFIG_HZ_1000=y
>   # CONFIG_MEMORY_HOTPLUG is not set
> +CONFIG_NR_CPUS=64
>   CONFIG_PREEMPT=y
>   # CONFIG_PREEMPT_NONE is not set
>   # CONFIG_PREEMPT_VOLUNTARY is not set
> diff --git a/debian.master/config/amd64/config.flavour.server b/debian.master/config/amd64/config.flavour.server
> index 8d734fb..75fcc3e 100644
> --- a/debian.master/config/amd64/config.flavour.server
> +++ b/debian.master/config/amd64/config.flavour.server
> @@ -8,6 +8,7 @@ CONFIG_HZ=100
>   CONFIG_HZ_100=y
>   # CONFIG_HZ_1000 is not set
>   CONFIG_MEMORY_HOTPLUG=y
> +CONFIG_NR_CPUS=256
>   # CONFIG_PREEMPT is not set
>   CONFIG_PREEMPT_NONE=y
>   # CONFIG_PREEMPT_VOLUNTARY is not set

Sounds like a very reasonable thing to do.

Acked-by: Brad Figg <brad.figg at canonical.com>

-- 
Brad Figg brad.figg at canonical.com http://www.canonical.com




More information about the kernel-team mailing list