Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7a8ef1cb authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds
Browse files

[PATCH] x86: don't initialise cpu_possible_map to all ones



Initialising cpu_possible_map to all-ones with CONFIG_HOTPLUG_CPU means that

a) All for_each_cpu() loops will iterate across all NR_CPUS CPUs, rather
   than over possible ones.  That can be quite expensive.

b) Soon we'll be allocating per-cpu areas only for possible CPUs.  So with
   CPU_MASK_ALL, we'll be wasting memory.

I also switched voyager over to not use CPU_MASK_ALL in the non-CPU-hotplug
case.  Should be OK..

I note that parisc is also using CPU_MASK_ALL.  Suggest that it stop doing
that.

Cc: James Bottomley <James.Bottomley@steeleye.com>
Cc: Kyle McMartin <kyle@mcmartin.ca>
Cc: Paul Jackson <pj@sgi.com>
Cc: Ashok Raj <ashok.raj@intel.com>
Cc: Zwane Mwaikambo <zwane@linuxpower.ca>
Cc: Paul Jackson <pj@sgi.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 70567293
Loading
Loading
Loading
Loading
+0 −4
Original line number Original line Diff line number Diff line
@@ -87,11 +87,7 @@ EXPORT_SYMBOL(cpu_online_map);
cpumask_t cpu_callin_map;
cpumask_t cpu_callin_map;
cpumask_t cpu_callout_map;
cpumask_t cpu_callout_map;
EXPORT_SYMBOL(cpu_callout_map);
EXPORT_SYMBOL(cpu_callout_map);
#ifdef CONFIG_HOTPLUG_CPU
cpumask_t cpu_possible_map = CPU_MASK_ALL;
#else
cpumask_t cpu_possible_map;
cpumask_t cpu_possible_map;
#endif
EXPORT_SYMBOL(cpu_possible_map);
EXPORT_SYMBOL(cpu_possible_map);
static cpumask_t smp_commenced_mask;
static cpumask_t smp_commenced_mask;


+1 −1
Original line number Original line Diff line number Diff line
@@ -240,7 +240,7 @@ static cpumask_t smp_commenced_mask = CPU_MASK_NONE;
cpumask_t cpu_callin_map = CPU_MASK_NONE;
cpumask_t cpu_callin_map = CPU_MASK_NONE;
cpumask_t cpu_callout_map = CPU_MASK_NONE;
cpumask_t cpu_callout_map = CPU_MASK_NONE;
EXPORT_SYMBOL(cpu_callout_map);
EXPORT_SYMBOL(cpu_callout_map);
cpumask_t cpu_possible_map = CPU_MASK_ALL;
cpumask_t cpu_possible_map = CPU_MASK_NONE;
EXPORT_SYMBOL(cpu_possible_map);
EXPORT_SYMBOL(cpu_possible_map);


/* The per processor IRQ masks (these are usually kept in sync) */
/* The per processor IRQ masks (these are usually kept in sync) */
+1 −1
Original line number Original line Diff line number Diff line
@@ -328,7 +328,7 @@ static inline void __cpus_remap(cpumask_t *dstp, const cpumask_t *srcp,
 * bitmap of size NR_CPUS.
 * bitmap of size NR_CPUS.
 *
 *
 *  #ifdef CONFIG_HOTPLUG_CPU
 *  #ifdef CONFIG_HOTPLUG_CPU
 *     cpu_possible_map - all NR_CPUS bits set
 *     cpu_possible_map - has bit 'cpu' set iff cpu is populatable
 *     cpu_present_map  - has bit 'cpu' set iff cpu is populated
 *     cpu_present_map  - has bit 'cpu' set iff cpu is populated
 *     cpu_online_map   - has bit 'cpu' set iff cpu available to scheduler
 *     cpu_online_map   - has bit 'cpu' set iff cpu available to scheduler
 *  #else
 *  #else