aboutsummaryrefslogtreecommitdiffstats
path: root/arch/m32r
diff options
context:
space:
mode:
authorNick Piggin <nickpiggin@yahoo.com.au>2005-11-09 00:39:01 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2005-11-09 10:56:33 -0500
commit5bfb5d690f36d316a5f3b4f7775fda996faa6b12 (patch)
treeea53f15293d1ddb49c316eb65df85e939a4f6e5e /arch/m32r
parentede3d0fba99520f268067917b50858d788bc41da (diff)
[PATCH] sched: disable preempt in idle tasks
Run idle threads with preempt disabled. Also corrected a bugs in arm26's cpu_idle (make it actually call schedule()). How did it ever work before? Might fix the CPU hotplugging hang which Nigel Cunningham noted. We think the bug hits if the idle thread is preempted after checking need_resched() and before going to sleep, then the CPU offlined. After calling stop_machine_run, the CPU eventually returns from preemption and into the idle thread and goes to sleep. The CPU will continue executing previous idle and have no chance to call play_dead. By disabling preemption until we are ready to explicitly schedule, this bug is fixed and the idle threads generally become more robust. From: alexs <ashepard@u.washington.edu> PPC build fix From: Yoichi Yuasa <yuasa@hh.iij4u.or.jp> MIPS build fix Signed-off-by: Nick Piggin <npiggin@suse.de> Signed-off-by: Yoichi Yuasa <yuasa@hh.iij4u.or.jp> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/m32r')
-rw-r--r--arch/m32r/kernel/process.c2
-rw-r--r--arch/m32r/kernel/smpboot.c1
2 files changed, 3 insertions, 0 deletions
diff --git a/arch/m32r/kernel/process.c b/arch/m32r/kernel/process.c
index ea13a8f4d8b0..cc4b571e5db7 100644
--- a/arch/m32r/kernel/process.c
+++ b/arch/m32r/kernel/process.c
@@ -104,7 +104,9 @@ void cpu_idle (void)
104 104
105 idle(); 105 idle();
106 } 106 }
107 preempt_enable_no_resched();
107 schedule(); 108 schedule();
109 preempt_disable();
108 } 110 }
109} 111}
110 112
diff --git a/arch/m32r/kernel/smpboot.c b/arch/m32r/kernel/smpboot.c
index 640d592ea072..b90c54169fa5 100644
--- a/arch/m32r/kernel/smpboot.c
+++ b/arch/m32r/kernel/smpboot.c
@@ -426,6 +426,7 @@ void __init smp_cpus_done(unsigned int max_cpus)
426int __init start_secondary(void *unused) 426int __init start_secondary(void *unused)
427{ 427{
428 cpu_init(); 428 cpu_init();
429 preempt_disable();
429 smp_callin(); 430 smp_callin();
430 while (!cpu_isset(smp_processor_id(), smp_commenced_mask)) 431 while (!cpu_isset(smp_processor_id(), smp_commenced_mask))
431 cpu_relax(); 432 cpu_relax();