diff options
author | Ingo Molnar <mingo@elte.hu> | 2010-07-05 02:30:55 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2010-07-05 02:30:58 -0400 |
commit | 08f8ba07998ab1b9efcdd3f28dadf6866a605ddb (patch) | |
tree | 8e09855446f7b0312bb729d4b539090756e57927 /init/main.c | |
parent | 0879b100f3c187257729f36cba33d96ec2875766 (diff) | |
parent | 815c4163b6c8ebf8152f42b0a5fd015cfdcedc78 (diff) |
Merge commit 'v2.6.35-rc4' into perf/core
Merge reason: Pick up the latest perf fixes
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'init/main.c')
-rw-r--r-- | init/main.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/init/main.c b/init/main.c index e407a05adc29..4ab5124a2952 100644 --- a/init/main.c +++ b/init/main.c | |||
@@ -422,18 +422,26 @@ static void __init setup_command_line(char *command_line) | |||
422 | * gcc-3.4 accidentally inlines this function, so use noinline. | 422 | * gcc-3.4 accidentally inlines this function, so use noinline. |
423 | */ | 423 | */ |
424 | 424 | ||
425 | static __initdata DECLARE_COMPLETION(kthreadd_done); | ||
426 | |||
425 | static noinline void __init_refok rest_init(void) | 427 | static noinline void __init_refok rest_init(void) |
426 | __releases(kernel_lock) | 428 | __releases(kernel_lock) |
427 | { | 429 | { |
428 | int pid; | 430 | int pid; |
429 | 431 | ||
430 | rcu_scheduler_starting(); | 432 | rcu_scheduler_starting(); |
433 | /* | ||
434 | * We need to spawn init first so that it obtains pid 1, however | ||
435 | * the init task will end up wanting to create kthreads, which, if | ||
436 | * we schedule it before we create kthreadd, will OOPS. | ||
437 | */ | ||
431 | kernel_thread(kernel_init, NULL, CLONE_FS | CLONE_SIGHAND); | 438 | kernel_thread(kernel_init, NULL, CLONE_FS | CLONE_SIGHAND); |
432 | numa_default_policy(); | 439 | numa_default_policy(); |
433 | pid = kernel_thread(kthreadd, NULL, CLONE_FS | CLONE_FILES); | 440 | pid = kernel_thread(kthreadd, NULL, CLONE_FS | CLONE_FILES); |
434 | rcu_read_lock(); | 441 | rcu_read_lock(); |
435 | kthreadd_task = find_task_by_pid_ns(pid, &init_pid_ns); | 442 | kthreadd_task = find_task_by_pid_ns(pid, &init_pid_ns); |
436 | rcu_read_unlock(); | 443 | rcu_read_unlock(); |
444 | complete(&kthreadd_done); | ||
437 | unlock_kernel(); | 445 | unlock_kernel(); |
438 | 446 | ||
439 | /* | 447 | /* |
@@ -849,6 +857,10 @@ static noinline int init_post(void) | |||
849 | 857 | ||
850 | static int __init kernel_init(void * unused) | 858 | static int __init kernel_init(void * unused) |
851 | { | 859 | { |
860 | /* | ||
861 | * Wait until kthreadd is all set-up. | ||
862 | */ | ||
863 | wait_for_completion(&kthreadd_done); | ||
852 | lock_kernel(); | 864 | lock_kernel(); |
853 | 865 | ||
854 | /* | 866 | /* |