mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Viresh Kumar <viresh.kumar@linaro.org>
To: tglx@linutronix.de, fweisbec@gmail.com, peterz@infradead.org,
	mingo@kernel.org, tj@kernel.org, lizefan@huawei.com
Cc: linaro-kernel@lists.linaro.org, linaro-networking@linaro.org,
	Arvind.Chauhan@arm.com, linux-kernel@vger.kernel.org,
	cgroups@vger.kernel.org, Viresh Kumar <viresh.kumar@linaro.org>
Subject: [PATCH V2 8/8] sched: don't queue timers on quiesced CPUs
Date: Fri,  4 Apr 2014 14:05:35 +0530	[thread overview]
Message-ID: <3fefafdf2d06b1d6ecc0e2cbb6f860f6c8cd8df2.1396599474.git.viresh.kumar@linaro.org> (raw)
In-Reply-To: <cover.1396599474.git.viresh.kumar@linaro.org>
In-Reply-To: <cover.1396599474.git.viresh.kumar@linaro.org>

CPUSets have cpusets.quiesce sysfs file now, with which some CPUs can opt for
isolating themselves from background kernel activities, like: timers & hrtimers.

get_nohz_timer_target() is used for finding suitable CPU for firing a timer. To
guarantee that new timers wouldn't be queued on quiesced CPUs, we need to modify
this routine.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 kernel/sched/core.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index c0339e2..b235af2 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -557,17 +557,18 @@ void resched_cpu(int cpu)
  */
 int get_nohz_timer_target(int pinned)
 {
-	int cpu = smp_processor_id();
-	int i;
+	int cpu = smp_processor_id(), i;
 	struct sched_domain *sd;
 
-	if (pinned || !get_sysctl_timer_migration() || !idle_cpu(cpu))
+	if (pinned || !get_sysctl_timer_migration() ||
+	    !(idle_cpu(cpu) || cpu_quiesced(cpu)))
 		return cpu;
 
 	rcu_read_lock();
 	for_each_domain(cpu, sd) {
 		for_each_cpu(i, sched_domain_span(sd)) {
-			if (!idle_cpu(i)) {
+			/* Don't push timers to quiesced CPUs */
+			if (!(cpu_quiesced(i) || idle_cpu(i))) {
 				cpu = i;
 				goto unlock;
 			}
-- 
1.7.12.rc2.18.g61b472e


  parent reply	other threads:[~2014-04-04  8:37 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-04  8:35 [PATCH V2 0/8] cpusets: Isolate CPUs via sysfs using cpusets Viresh Kumar
2014-04-04  8:35 ` [PATCH V2 1/8] timer: track pinned timers with TIMER_PINNED flag Viresh Kumar
2014-04-04  8:35 ` [PATCH V2 2/8] timer: don't migrate pinned timers Viresh Kumar
2014-04-04  8:35 ` [PATCH V2 3/8] timer: create timer_quiesce_cpu() to isolate CPU from timers Viresh Kumar
2014-04-04  8:35 ` [PATCH V2 4/8] hrtimer: update timer->state with 'pinned' information Viresh Kumar
2014-04-04  8:35 ` [PATCH V2 5/8] hrtimer: don't migrate pinned timers Viresh Kumar
2014-04-04  8:35 ` [PATCH V2 6/8] hrtimer: create hrtimer_quiesce_cpu() to isolate CPU from hrtimers Viresh Kumar
2014-04-04  8:35 ` [PATCH V2 7/8] cpuset: Create sysfs file: cpusets.quiesce to isolate CPUs Viresh Kumar
2014-04-04  8:35 ` Viresh Kumar [this message]
2014-04-06  8:30 ` [PATCH V2 0/8] cpusets: Isolate CPUs via sysfs using cpusets Mike Galbraith
2014-04-07  4:11   ` Viresh Kumar
2014-04-07  5:04     ` Mike Galbraith
2014-04-07  5:17       ` Viresh Kumar

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=3fefafdf2d06b1d6ecc0e2cbb6f860f6c8cd8df2.1396599474.git.viresh.kumar@linaro.org \
    --to=viresh.kumar@linaro.org \
    --cc=Arvind.Chauhan@arm.com \
    --cc=cgroups@vger.kernel.org \
    --cc=fweisbec@gmail.com \
    --cc=linaro-kernel@lists.linaro.org \
    --cc=linaro-networking@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizefan@huawei.com \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=tj@kernel.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

all inboxes | Powered by JetHome®