aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Lutomirski <luto@amacapital.net>2014-06-04 10:31:17 -0700
committerAlex Shi <alex.shi@linaro.org>2014-12-03 14:51:48 +0800
commit95ec016860904331c594cdfde6385816feb1e16a (patch)
tree5f489b0ad0bc923b5d51206943bfd7311746b519
parent86c002558e55a9eb1465c5fe20c041561aa185d4 (diff)
sched/idle: Simplify wake_up_idle_cpu()
Now that rq->idle's polling bit is a reliable indication that the cpu is polling, use it. Signed-off-by: Andy Lutomirski <luto@amacapital.net> Signed-off-by: Peter Zijlstra <peterz@infradead.org> Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Cc: nicolas.pitre@linaro.org Cc: daniel.lezcano@linaro.org Cc: umgwanakikbuti@gmail.com Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: linux-kernel@vger.kernel.org Link: http://lkml.kernel.org/r/922f00761445a830ebb23d058e2ae53956ce2d73.1401902905.git.luto@amacapital.net Signed-off-by: Ingo Molnar <mingo@kernel.org> (cherry picked from commit 67b9ca70c3030e832999e8d1cdba2984c7bb5bfc) Signed-off-by: Alex Shi <alex.shi@linaro.org>
-rw-r--r--kernel/sched/core.c21
1 files changed, 1 insertions, 20 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 588c4cc2cdb..bbaf6e5d1d0 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -626,26 +626,7 @@ static void wake_up_idle_cpu(int cpu)
if (cpu == smp_processor_id())
return;
- /*
- * This is safe, as this function is called with the timer
- * wheel base lock of (cpu) held. When the CPU is on the way
- * to idle and has not yet set rq->curr to idle then it will
- * be serialized on the timer wheel base lock and take the new
- * timer into account automatically.
- */
- if (rq->curr != rq->idle)
- return;
-
- /*
- * We can set TIF_RESCHED on the idle task of the other CPU
- * lockless. The worst case is that the other CPU runs the
- * idle task through an additional NOOP schedule()
- */
- set_tsk_need_resched(rq->idle);
-
- /* NEED_RESCHED must be visible before we test polling */
- smp_mb();
- if (!tsk_is_polling(rq->idle))
+ if (set_nr_and_not_polling(rq->idle))
smp_send_reschedule(cpu);
else
trace_sched_wake_idle_without_ipi(cpu);