diff options
author | Paul Mackerras <paulus@samba.org> | 2005-11-10 11:06:04 +1100 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2005-11-10 11:06:04 +1100 |
commit | 31e7f1ff3c5d39a70da85f7d81a1ab1f4e64fa97 (patch) | |
tree | a6cb8f14b1182e5dce55d13e52c1182a8c7e0402 /arch/ppc64 | |
parent | fca5dcd4835ed09bb1a48a355344aff7a25c76e0 (diff) | |
parent | 6730c3c14421b7c924d06e31bb66e0adad225547 (diff) |
Merge ../linux-2.6
Diffstat (limited to 'arch/ppc64')
-rw-r--r-- | arch/ppc64/kernel/idle.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/arch/ppc64/kernel/idle.c b/arch/ppc64/kernel/idle.c index 8fec2746980..715bc0e71e0 100644 --- a/arch/ppc64/kernel/idle.c +++ b/arch/ppc64/kernel/idle.c @@ -34,15 +34,11 @@ extern void power4_idle(void); void default_idle(void) { - long oldval; unsigned int cpu = smp_processor_id(); + set_thread_flag(TIF_POLLING_NRFLAG); while (1) { - oldval = test_and_clear_thread_flag(TIF_NEED_RESCHED); - - if (!oldval) { - set_thread_flag(TIF_POLLING_NRFLAG); - + if (!need_resched()) { while (!need_resched() && !cpu_is_offline(cpu)) { ppc64_runlatch_off(); @@ -55,13 +51,12 @@ void default_idle(void) } HMT_medium(); - clear_thread_flag(TIF_POLLING_NRFLAG); - } else { - set_need_resched(); } ppc64_runlatch_on(); + preempt_enable_no_resched(); schedule(); + preempt_disable(); if (cpu_is_offline(cpu) && system_state == SYSTEM_RUNNING) cpu_die(); } @@ -77,7 +72,9 @@ void native_idle(void) if (need_resched()) { ppc64_runlatch_on(); + preempt_enable_no_resched(); schedule(); + preempt_disable(); } if (cpu_is_offline(smp_processor_id()) && |