diff options
| author | Ingo Molnar <mingo@elte.hu> | 2002-06-19 14:44:33 +0200 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.transmeta.com> | 2002-06-19 14:44:33 +0200 |
| commit | edcd262d9c26c606bc401dd67faaad1eec2e1909 (patch) | |
| tree | aab6b555b91fbeb8e4be872e1580e65050b41979 | |
| parent | 278b098bc992a0e654736d2a55b2bd2551af116a (diff) | |
- this patch fixes the migration init to correctly work with the
new hot-pluggable CPU enumeration method, and the possibility
to not boot on CPU#0.
(btw., i find RR's comment offensive. How can any code be called 'crap' just
because the author of a new patch has not converted the code to the new
assumptions yet? The original code was perfectly valid.)
| -rw-r--r-- | kernel/sched.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index 4436e028db04..f22be53b00c2 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -1775,6 +1775,8 @@ out: preempt_enable(); } +static __initdata int master_migration_thread; + static int migration_thread(void * bind_cpu) { int cpu = (int) (long) bind_cpu; @@ -1786,14 +1788,12 @@ static int migration_thread(void * bind_cpu) sigfillset(¤t->blocked); set_fs(KERNEL_DS); - /* FIXME: First CPU may not be zero, but this crap code - vanishes with hotplug cpu patch anyway. --RR */ /* - * The first migration thread is started on CPU #0. This one can - * migrate the other migration threads to their destination CPUs. + * The first migration thread is started on the boot CPU, it + * migrates the other migration threads to their destination CPUs. */ - if (cpu != 0) { - while (!cpu_rq(0)->migration_thread) + if (cpu != master_migration_thread) { + while (!cpu_rq(master_migration_thread)->migration_thread) yield(); set_cpus_allowed(current, 1UL << cpu); } @@ -1857,7 +1857,9 @@ void __init migration_init(void) { int cpu; - current->cpus_allowed = 1UL << 0; + master_migration_thread = smp_processor_id(); + current->cpus_allowed = 1UL << master_migration_thread; + for (cpu = 0; cpu < NR_CPUS; cpu++) { if (!cpu_online(cpu)) continue; |
