diff options
author | Viresh Kumar <viresh.kumar@linaro.org> | 2014-03-31 16:30:54 +0530 |
---|---|---|
committer | Viresh Kumar <viresh.kumar@linaro.org> | 2014-09-05 09:52:50 +0530 |
commit | 0218350160c4d4470de4e6fc5ee9e84eb1bc09ae (patch) | |
tree | 18610020e8a907501b5979aadea45f4ecb58967e | |
parent | c7045ca7dc9895e732d99611aa8e6835cc9a696b (diff) |
sched: don't queue timers on quiesced CPUs
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>
-rw-r--r-- | kernel/sched/core.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 9a7afadff1f4..1b20fc0ec4a7 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; } |