aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ppc64
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2005-11-09 19:06:04 -0500
committerPaul Mackerras <paulus@samba.org>2005-11-09 19:06:04 -0500
commit31e7f1ff3c5d39a70da85f7d81a1ab1f4e64fa97 (patch)
treea6cb8f14b1182e5dce55d13e52c1182a8c7e0402 /arch/ppc64
parentfca5dcd4835ed09bb1a48a355344aff7a25c76e0 (diff)
parent6730c3c14421b7c924d06e31bb66e0adad225547 (diff)
Merge ../linux-2.6
Diffstat (limited to 'arch/ppc64')
-rw-r--r--arch/ppc64/kernel/idle.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/arch/ppc64/kernel/idle.c b/arch/ppc64/kernel/idle.c
index 8fec27469802..715bc0e71e0f 100644
--- a/arch/ppc64/kernel/idle.c
+++ b/arch/ppc64/kernel/idle.c
@@ -34,15 +34,11 @@ extern void power4_idle(void);
34 34
35void default_idle(void) 35void default_idle(void)
36{ 36{
37 long oldval;
38 unsigned int cpu = smp_processor_id(); 37 unsigned int cpu = smp_processor_id();
38 set_thread_flag(TIF_POLLING_NRFLAG);
39 39
40 while (1) { 40 while (1) {
41 oldval = test_and_clear_thread_flag(TIF_NEED_RESCHED); 41 if (!need_resched()) {
42
43 if (!oldval) {
44 set_thread_flag(TIF_POLLING_NRFLAG);
45
46 while (!need_resched() && !cpu_is_offline(cpu)) { 42 while (!need_resched() && !cpu_is_offline(cpu)) {
47 ppc64_runlatch_off(); 43 ppc64_runlatch_off();
48 44
@@ -55,13 +51,12 @@ void default_idle(void)
55 } 51 }
56 52
57 HMT_medium(); 53 HMT_medium();
58 clear_thread_flag(TIF_POLLING_NRFLAG);
59 } else {
60 set_need_resched();
61 } 54 }
62 55
63 ppc64_runlatch_on(); 56 ppc64_runlatch_on();
57 preempt_enable_no_resched();
64 schedule(); 58 schedule();
59 preempt_disable();
65 if (cpu_is_offline(cpu) && system_state == SYSTEM_RUNNING) 60 if (cpu_is_offline(cpu) && system_state == SYSTEM_RUNNING)
66 cpu_die(); 61 cpu_die();
67 } 62 }
@@ -77,7 +72,9 @@ void native_idle(void)
77 72
78 if (need_resched()) { 73 if (need_resched()) {
79 ppc64_runlatch_on(); 74 ppc64_runlatch_on();
75 preempt_enable_no_resched();
80 schedule(); 76 schedule();
77 preempt_disable();
81 } 78 }
82 79
83 if (cpu_is_offline(smp_processor_id()) && 80 if (cpu_is_offline(smp_processor_id()) &&