aboutsummaryrefslogtreecommitdiffstats
path: root/arch/i386/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'arch/i386/kernel')
-rw-r--r--arch/i386/kernel/apm.c6
-rw-r--r--arch/i386/kernel/process.c7
2 files changed, 11 insertions, 2 deletions
diff --git a/arch/i386/kernel/apm.c b/arch/i386/kernel/apm.c
index b75cff25de4b..199016927541 100644
--- a/arch/i386/kernel/apm.c
+++ b/arch/i386/kernel/apm.c
@@ -785,7 +785,11 @@ static int apm_do_idle(void)
785 polling = !!(current_thread_info()->status & TS_POLLING); 785 polling = !!(current_thread_info()->status & TS_POLLING);
786 if (polling) { 786 if (polling) {
787 current_thread_info()->status &= ~TS_POLLING; 787 current_thread_info()->status &= ~TS_POLLING;
788 smp_mb__after_clear_bit(); 788 /*
789 * TS_POLLING-cleared state must be visible before we
790 * test NEED_RESCHED:
791 */
792 smp_mb();
789 } 793 }
790 if (!need_resched()) { 794 if (!need_resched()) {
791 idled = 1; 795 idled = 1;
diff --git a/arch/i386/kernel/process.c b/arch/i386/kernel/process.c
index 99308510a17c..c641056233a6 100644
--- a/arch/i386/kernel/process.c
+++ b/arch/i386/kernel/process.c
@@ -102,7 +102,12 @@ void default_idle(void)
102{ 102{
103 if (!hlt_counter && boot_cpu_data.hlt_works_ok) { 103 if (!hlt_counter && boot_cpu_data.hlt_works_ok) {
104 current_thread_info()->status &= ~TS_POLLING; 104 current_thread_info()->status &= ~TS_POLLING;
105 smp_mb__after_clear_bit(); 105 /*
106 * TS_POLLING-cleared state must be visible before we
107 * test NEED_RESCHED:
108 */
109 smp_mb();
110
106 local_irq_disable(); 111 local_irq_disable();
107 if (!need_resched()) 112 if (!need_resched())
108 safe_halt(); /* enables interrupts racelessly */ 113 safe_halt(); /* enables interrupts racelessly */