diff options
author | Viresh Kumar <viresh.kumar@linaro.org> | 2014-03-31 16:30:54 +0530 |
---|---|---|
committer | Gary S. Robertson <gary.robertson@linaro.org> | 2015-07-22 16:17:08 -0500 |
commit | 451d0fcf3d9535a0a494c07066b52b29bf129bad (patch) | |
tree | 985628e5d926650715c1f6984496658ff16c1986 | |
parent | 5bab778fedcb09584c8653b70c28346da686ac7b (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 | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c index f093b200d8ad..1a7868cd2d1b 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -693,13 +693,15 @@ int get_nohz_timer_target(int pinned) preempt_disable_rt(); cpu = smp_processor_id(); - if (pinned || !get_sysctl_timer_migration() || !idle_cpu(cpu)) + if (pinned || !get_sysctl_timer_migration() || + !(idle_cpu(cpu) || cpu_quiesced(cpu))) goto preempt_en_rt; 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; } |