Commit 9ef49e90 authored by Rusty Russell's avatar Rusty Russell Committed by Russell King

[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.
parent e861caac
......@@ -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();
......
......@@ -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);
......
......@@ -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);
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