[PATCH] Tweak idle thread setup semantics
This patch tweaks idle thread setup semantics a bit: instead of setting NEED_RESCHED in init_idle(), we do an explicit schedule() before calling into cpu_idle(). This patch, while having no negative side-effects, enables wider use of cond_resched()s. (which might happen in the stock kernel too, but it's particulary important for voluntary-preempt) Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:

committed by
Linus Torvalds

parent
082cf69eb8
commit
f340c0d1a3
@@ -383,6 +383,13 @@ static void noinline rest_init(void)
|
||||
numa_default_policy();
|
||||
unlock_kernel();
|
||||
preempt_enable_no_resched();
|
||||
|
||||
/*
|
||||
* The boot idle thread must execute schedule()
|
||||
* at least one to get things moving:
|
||||
*/
|
||||
schedule();
|
||||
|
||||
cpu_idle();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user