aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel/smp.c
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/sh/kernel/smp.c
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/sh/kernel/smp.c')
-rw-r--r--arch/sh/kernel/smp.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/sh/kernel/smp.c b/arch/sh/kernel/smp.c
index 5ecefc02896..59e49b18252 100644
--- a/arch/sh/kernel/smp.c
+++ b/arch/sh/kernel/smp.c
@@ -112,7 +112,9 @@ int __cpu_up(unsigned int cpu)
112 112
113int start_secondary(void *unused) 113int start_secondary(void *unused)
114{ 114{
115 unsigned int cpu = smp_processor_id(); 115 unsigned int cpu;
116
117 cpu = smp_processor_id();
116 118
117 atomic_inc(&init_mm.mm_count); 119 atomic_inc(&init_mm.mm_count);
118 current->active_mm = &init_mm; 120 current->active_mm = &init_mm;
@@ -120,6 +122,7 @@ int start_secondary(void *unused)
120 smp_store_cpu_info(cpu); 122 smp_store_cpu_info(cpu);
121 123
122 __smp_slave_init(cpu); 124 __smp_slave_init(cpu);
125 preempt_disable();
123 per_cpu_trap_init(); 126 per_cpu_trap_init();
124 127
125 atomic_inc(&cpus_booted); 128 atomic_inc(&cpus_booted);