diff options
author | Jeff Garzik <jgarzik@pobox.com> | 2005-11-11 23:39:35 -0500 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-11-11 23:39:35 -0500 |
commit | f4256e301d9800b1e0276404cb01b3ac85b51067 (patch) | |
tree | 975f56627b78f757608b31684311a24ca1478481 /arch/ppc64/kernel/idle.c | |
parent | fb2a26b9f8f5eda6b96ba9753edf105e5999d6d9 (diff) | |
parent | cd52d1ee9a92587b242d946a2300a3245d3b885a (diff) |
Merge branch 'master'
Diffstat (limited to 'arch/ppc64/kernel/idle.c')
-rw-r--r-- | arch/ppc64/kernel/idle.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/arch/ppc64/kernel/idle.c b/arch/ppc64/kernel/idle.c index 8fec27469802..b879d3057ef8 100644 --- a/arch/ppc64/kernel/idle.c +++ b/arch/ppc64/kernel/idle.c | |||
@@ -26,7 +26,6 @@ | |||
26 | #include <asm/processor.h> | 26 | #include <asm/processor.h> |
27 | #include <asm/cputable.h> | 27 | #include <asm/cputable.h> |
28 | #include <asm/time.h> | 28 | #include <asm/time.h> |
29 | #include <asm/systemcfg.h> | ||
30 | #include <asm/machdep.h> | 29 | #include <asm/machdep.h> |
31 | #include <asm/smp.h> | 30 | #include <asm/smp.h> |
32 | 31 | ||
@@ -34,15 +33,11 @@ extern void power4_idle(void); | |||
34 | 33 | ||
35 | void default_idle(void) | 34 | void default_idle(void) |
36 | { | 35 | { |
37 | long oldval; | ||
38 | unsigned int cpu = smp_processor_id(); | 36 | unsigned int cpu = smp_processor_id(); |
37 | set_thread_flag(TIF_POLLING_NRFLAG); | ||
39 | 38 | ||
40 | while (1) { | 39 | while (1) { |
41 | oldval = test_and_clear_thread_flag(TIF_NEED_RESCHED); | 40 | if (!need_resched()) { |
42 | |||
43 | if (!oldval) { | ||
44 | set_thread_flag(TIF_POLLING_NRFLAG); | ||
45 | |||
46 | while (!need_resched() && !cpu_is_offline(cpu)) { | 41 | while (!need_resched() && !cpu_is_offline(cpu)) { |
47 | ppc64_runlatch_off(); | 42 | ppc64_runlatch_off(); |
48 | 43 | ||
@@ -55,13 +50,12 @@ void default_idle(void) | |||
55 | } | 50 | } |
56 | 51 | ||
57 | HMT_medium(); | 52 | HMT_medium(); |
58 | clear_thread_flag(TIF_POLLING_NRFLAG); | ||
59 | } else { | ||
60 | set_need_resched(); | ||
61 | } | 53 | } |
62 | 54 | ||
63 | ppc64_runlatch_on(); | 55 | ppc64_runlatch_on(); |
56 | preempt_enable_no_resched(); | ||
64 | schedule(); | 57 | schedule(); |
58 | preempt_disable(); | ||
65 | if (cpu_is_offline(cpu) && system_state == SYSTEM_RUNNING) | 59 | if (cpu_is_offline(cpu) && system_state == SYSTEM_RUNNING) |
66 | cpu_die(); | 60 | cpu_die(); |
67 | } | 61 | } |
@@ -77,7 +71,9 @@ void native_idle(void) | |||
77 | 71 | ||
78 | if (need_resched()) { | 72 | if (need_resched()) { |
79 | ppc64_runlatch_on(); | 73 | ppc64_runlatch_on(); |
74 | preempt_enable_no_resched(); | ||
80 | schedule(); | 75 | schedule(); |
76 | preempt_disable(); | ||
81 | } | 77 | } |
82 | 78 | ||
83 | if (cpu_is_offline(smp_processor_id()) && | 79 | if (cpu_is_offline(smp_processor_id()) && |