aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc
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/powerpc
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/powerpc')
-rw-r--r--arch/powerpc/platforms/iseries/setup.c4
-rw-r--r--arch/powerpc/platforms/pseries/setup.c4
2 files changed, 8 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/iseries/setup.c b/arch/powerpc/platforms/iseries/setup.c
index d3e4bf756c8..0130f2619da 100644
--- a/arch/powerpc/platforms/iseries/setup.c
+++ b/arch/powerpc/platforms/iseries/setup.c
@@ -694,7 +694,9 @@ static void iseries_shared_idle(void)
694 if (hvlpevent_is_pending()) 694 if (hvlpevent_is_pending())
695 process_iSeries_events(); 695 process_iSeries_events();
696 696
697 preempt_enable_no_resched();
697 schedule(); 698 schedule();
699 preempt_disable();
698 } 700 }
699} 701}
700 702
@@ -726,7 +728,9 @@ static void iseries_dedicated_idle(void)
726 } 728 }
727 729
728 ppc64_runlatch_on(); 730 ppc64_runlatch_on();
731 preempt_enable_no_resched();
729 schedule(); 732 schedule();
733 preempt_disable();
730 } 734 }
731} 735}
732 736
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c
index e78c3936884..4854f5eb5c3 100644
--- a/arch/powerpc/platforms/pseries/setup.c
+++ b/arch/powerpc/platforms/pseries/setup.c
@@ -539,7 +539,9 @@ static void pseries_dedicated_idle(void)
539 lpaca->lppaca.idle = 0; 539 lpaca->lppaca.idle = 0;
540 ppc64_runlatch_on(); 540 ppc64_runlatch_on();
541 541
542 preempt_enable_no_resched();
542 schedule(); 543 schedule();
544 preempt_disable();
543 545
544 if (cpu_is_offline(cpu) && system_state == SYSTEM_RUNNING) 546 if (cpu_is_offline(cpu) && system_state == SYSTEM_RUNNING)
545 cpu_die(); 547 cpu_die();
@@ -583,7 +585,9 @@ static void pseries_shared_idle(void)
583 lpaca->lppaca.idle = 0; 585 lpaca->lppaca.idle = 0;
584 ppc64_runlatch_on(); 586 ppc64_runlatch_on();
585 587
588 preempt_enable_no_resched();
586 schedule(); 589 schedule();
590 preempt_disable();
587 591
588 if (cpu_is_offline(cpu) && system_state == SYSTEM_RUNNING) 592 if (cpu_is_offline(cpu) && system_state == SYSTEM_RUNNING)
589 cpu_die(); 593 cpu_die();