diff options
| author | Rusty Russell <rusty@rustcorp.com.au> | 2002-07-27 06:06:48 -0700 |
|---|---|---|
| committer | Russell King <rmk@flint.arm.linux.org.uk> | 2002-07-27 06:06:48 -0700 |
| commit | 9ef49e9038d08fa341ec1d19b00401f7939fb31c (patch) | |
| tree | e39894dcb037e04a60323eeca779dc6be9245969 | |
| parent | e861caac171fb06e09d040b6b817e47fa1a85e49 (diff) | |
[PATCH] Fix ksoftirqd and migration threads initcalls
This patch fixes the calls to initialize ksoftirqd and the
migration threads. This really should be done by the initcall
depends patch.
| -rw-r--r-- | init/main.c | 12 | ||||
| -rw-r--r-- | kernel/sched.c | 5 | ||||
| -rw-r--r-- | kernel/softirq.c | 4 |
3 files changed, 16 insertions, 5 deletions
diff --git a/init/main.c b/init/main.c index a1c080027c3b..2d72a8a3183d 100644 --- a/init/main.c +++ b/init/main.c @@ -524,6 +524,15 @@ static void __init do_basic_setup(void) do_initcalls(); } +static void do_pre_smp_initcalls(void) +{ + extern int migration_init(void); + extern int spawn_ksoftirqd(void); + + migration_init(); + spawn_ksoftirqd(); +} + extern void prepare_namespace(void); static int init(void * unused) @@ -533,6 +542,9 @@ static int init(void * unused) lock_kernel(); /* Sets up cpus_possible() */ smp_prepare_cpus(max_cpus); + + do_pre_smp_initcalls(); + smp_init(); do_basic_setup(); diff --git a/kernel/sched.c b/kernel/sched.c index 67ac32a24c1f..ada00056ba12 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -1894,6 +1894,8 @@ static int migration_call(struct notifier_block *nfb, (long)hcpu); kernel_thread(migration_thread, hcpu, CLONE_FS | CLONE_FILES | CLONE_SIGNAL); + while (!cpu_rq((long)hcpu)->migration_thread) + yield(); break; } return NOTIFY_OK; @@ -1901,7 +1903,7 @@ static int migration_call(struct notifier_block *nfb, static struct notifier_block migration_notifier = { &migration_call, NULL, 0 }; -int __init migration_init(void) +__init int migration_init(void) { /* Start one for boot CPU. */ migration_call(&migration_notifier, CPU_ONLINE, @@ -1910,7 +1912,6 @@ int __init migration_init(void) return 0; } -__initcall(migration_init); #endif extern void init_timervecs(void); diff --git a/kernel/softirq.c b/kernel/softirq.c index 38ae82b344c0..4f606e1acbd9 100644 --- a/kernel/softirq.c +++ b/kernel/softirq.c @@ -410,11 +410,9 @@ static int __devinit cpu_callback(struct notifier_block *nfb, static struct notifier_block cpu_nfb = { &cpu_callback, NULL, 0 }; -static __init int spawn_ksoftirqd(void) +__init int spawn_ksoftirqd(void) { cpu_callback(&cpu_nfb, CPU_ONLINE, (void *)smp_processor_id()); register_cpu_notifier(&cpu_nfb); return 0; } - -__initcall(spawn_ksoftirqd); |
