Commit 602c7aa8 authored by Robert Love's avatar Robert Love Committed by Linus Torvalds

[PATCH] mark 3 variables as __initdata

The attached patch marks the following variables with __initdata:

        arch/i386/kernel/mpparse.c :: static unsigned int num_processors
        arch/i386/kernel/smpboot.c :: static int smp_b_stepping
        arch/i386/kernel/smpboot.c :: static int max_cpus

The data is static and only used by __init functions so can successfully
be jettisoned after boot.  Compiled and booted successfully on an SMP
machine.

I also set max_cpus to NR_CPUS instead of -1.  Besides being the
logically correct value and simplifying a loop elsewhere, this change
allows NR_CPUS to be set to various values other than the normal 32
which is growing in utility with the hotplug CPU changes now in
mainline.
parent 33bb8238
...@@ -64,7 +64,7 @@ unsigned long mp_lapic_addr; ...@@ -64,7 +64,7 @@ unsigned long mp_lapic_addr;
unsigned int boot_cpu_physical_apicid = -1U; unsigned int boot_cpu_physical_apicid = -1U;
unsigned int boot_cpu_logical_apicid = -1U; unsigned int boot_cpu_logical_apicid = -1U;
/* Internal processor count */ /* Internal processor count */
static unsigned int num_processors; static unsigned int __initdata num_processors;
/* Bitmask of physically existing CPUs */ /* Bitmask of physically existing CPUs */
unsigned long phys_cpu_present_map; unsigned long phys_cpu_present_map;
......
...@@ -50,11 +50,11 @@ ...@@ -50,11 +50,11 @@
#include <asm/tlbflush.h> #include <asm/tlbflush.h>
#include <asm/smpboot.h> #include <asm/smpboot.h>
/* Set if we find a B stepping CPU */ /* Set if we find a B stepping CPU */
static int smp_b_stepping; static int __initdata smp_b_stepping;
/* Setup configured maximum number of CPUs to activate */ /* Setup configured maximum number of CPUs to activate */
static int max_cpus = -1; static int __initdata max_cpus = NR_CPUS;
/* Number of siblings per CPU package */ /* Number of siblings per CPU package */
int smp_num_siblings = 1; int smp_num_siblings = 1;
...@@ -1146,7 +1146,7 @@ void __init smp_boot_cpus(void) ...@@ -1146,7 +1146,7 @@ void __init smp_boot_cpus(void)
if (!(phys_cpu_present_map & (1 << bit))) if (!(phys_cpu_present_map & (1 << bit)))
continue; continue;
if ((max_cpus >= 0) && (max_cpus <= cpucount+1)) if (max_cpus <= cpucount+1)
continue; continue;
do_boot_cpu(apicid); do_boot_cpu(apicid);
......
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