From: tip-bot for Andy Lutomirski <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@kernel.org,
torvalds@linux-foundation.org, peterz@infradead.org,
rafael.j.wysocki@intel.com, luto@amacapital.net,
tglx@linutronix.de
Subject: [tip:sched/core] sched/idle: Simplify wake_up_idle_cpu()
Date: Thu, 5 Jun 2014 07:37:43 -0700 [thread overview]
Message-ID: <tip-67b9ca70c3030e832999e8d1cdba2984c7bb5bfc@git.kernel.org> (raw)
In-Reply-To: <922f00761445a830ebb23d058e2ae53956ce2d73.1401902905.git.luto@amacapital.net>
Commit-ID: 67b9ca70c3030e832999e8d1cdba2984c7bb5bfc
Gitweb: http://git.kernel.org/tip/67b9ca70c3030e832999e8d1cdba2984c7bb5bfc
Author: Andy Lutomirski <luto@amacapital.net>
AuthorDate: Wed, 4 Jun 2014 10:31:17 -0700
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Thu, 5 Jun 2014 12:09:52 +0200
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>
---
kernel/sched/core.c | 21 +--------------------
1 file changed, 1 insertion(+), 20 deletions(-)
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index e4c0ddd..6afbfee 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -628,26 +628,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);
next prev parent reply other threads:[~2014-06-05 14:43 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-04 17:31 [PATCH v2 0/5] sched: Cleanup and improve polling idle loops Andy Lutomirski
2014-06-04 17:31 ` [PATCH v2 1/5] cpuidle: Set polling in poll_idle Andy Lutomirski
2014-06-05 14:37 ` [tip:sched/core] " tip-bot for Andy Lutomirski
2014-06-04 17:31 ` [PATCH v2 2/5] sched,trace: Add a tracepoint for IPI-less remote wakeups Andy Lutomirski
2014-06-05 14:37 ` [tip:sched/core] sched, trace: " tip-bot for Andy Lutomirski
2014-06-04 17:31 ` [PATCH v2 3/5] sched,idle: Clear polling before descheduling the idle thread Andy Lutomirski
2014-06-04 17:36 ` Peter Zijlstra
2014-06-05 14:37 ` [tip:sched/core] sched/idle: " tip-bot for Andy Lutomirski
2014-06-04 17:31 ` [PATCH v2 4/5] sched,idle: Simplify wake_up_idle_cpu Andy Lutomirski
2014-06-05 14:37 ` tip-bot for Andy Lutomirski [this message]
2014-06-04 17:31 ` [PATCH v2 5/5] sched: Optimize ttwu IPI Andy Lutomirski
2014-06-05 14:37 ` [tip:sched/core] sched/idle: Optimize try-to-wake-up IPI tip-bot for Peter Zijlstra
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tip-67b9ca70c3030e832999e8d1cdba2984c7bb5bfc@git.kernel.org \
--to=tipbot@zytor.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=rafael.j.wysocki@intel.com \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox