129
129
static char *execute_command;
130
130
static char *ramdisk_execute_command;
133
/* Setup configured maximum number of CPUs to activate */
134
unsigned int setup_max_cpus = NR_CPUS;
135
EXPORT_SYMBOL(setup_max_cpus);
139
* Setup routine for controlling SMP activation
141
* Command-line option of "nosmp" or "maxcpus=0" will disable SMP
142
* activation entirely (the MPS table probe still happens, though).
144
* Command-line option of "maxcpus=<NUM>", where <NUM> is an integer
145
* greater than 0, limits the maximum number of CPUs activated in
149
void __weak arch_disable_smp_support(void) { }
151
static int __init nosmp(char *str)
154
arch_disable_smp_support();
159
early_param("nosmp", nosmp);
161
/* this is hard limit */
162
static int __init nrcpus(char *str)
166
get_option(&str, &nr_cpus);
167
if (nr_cpus > 0 && nr_cpus < nr_cpu_ids)
168
nr_cpu_ids = nr_cpus;
173
early_param("nr_cpus", nrcpus);
175
static int __init maxcpus(char *str)
177
get_option(&str, &setup_max_cpus);
178
if (setup_max_cpus == 0)
179
arch_disable_smp_support();
184
early_param("maxcpus", maxcpus);
186
static const unsigned int setup_max_cpus = NR_CPUS;
190
133
* If set, this is an indication to the drivers that reset the underlying
191
134
* device before going ahead with the initialization otherwise driver might
362
305
__setup("rdinit=", rdinit_setup);
364
307
#ifndef CONFIG_SMP
308
static const unsigned int setup_max_cpus = NR_CPUS;
366
309
#ifdef CONFIG_X86_LOCAL_APIC
367
310
static void __init smp_init(void)
375
318
static inline void setup_nr_cpu_ids(void) { }
376
319
static inline void smp_prepare_cpus(unsigned int maxcpus) { }
380
/* Setup number of possible processor ids */
381
int nr_cpu_ids __read_mostly = NR_CPUS;
382
EXPORT_SYMBOL(nr_cpu_ids);
384
/* An arch may set nr_cpu_ids earlier if needed, so this would be redundant */
385
static void __init setup_nr_cpu_ids(void)
387
nr_cpu_ids = find_last_bit(cpumask_bits(cpu_possible_mask),NR_CPUS) + 1;
390
/* Called by boot processor to activate the rest. */
391
static void __init smp_init(void)
395
/* FIXME: This should be done in userspace --RR */
396
for_each_present_cpu(cpu) {
397
if (num_online_cpus() >= setup_max_cpus)
399
if (!cpu_online(cpu))
403
/* Any cleanup work */
404
printk(KERN_INFO "Brought up %ld CPUs\n", (long)num_online_cpus());
405
smp_cpus_done(setup_max_cpus);
875
787
* init can run on any cpu.
877
789
set_cpus_allowed_ptr(current, cpu_all_mask);
879
* Tell the world that we're going to be the grim
880
* reaper of innocent orphaned children.
882
* We don't want people to have to make incorrect
883
* assumptions about where in the task array this
886
init_pid_ns.child_reaper = current;
888
791
cad_pid = task_pid(current);