diff options
author | Frederic Weisbecker <frederic@kernel.org> | 2018-02-21 05:17:27 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2018-02-21 09:49:09 +0100 |
commit | d84b31313ef8a8de55a2cbfb72f76f36d8c927fb (patch) | |
tree | 24101d3e47de3fbdadd962a02d816d6a2f5ceb12 /kernel/sched/fair.c | |
parent | 1bda3f8087fce9063da0b8aef87f17a3fe541aca (diff) | |
download | linux-stable-d84b31313ef8a8de55a2cbfb72f76f36d8c927fb.tar.gz linux-stable-d84b31313ef8a8de55a2cbfb72f76f36d8c927fb.tar.bz2 linux-stable-d84b31313ef8a8de55a2cbfb72f76f36d8c927fb.zip |
sched/isolation: Offload residual 1Hz scheduler tick
When a CPU runs in full dynticks mode, a 1Hz tick remains in order to
keep the scheduler stats alive. However this residual tick is a burden
for bare metal tasks that can't stand any interruption at all, or want
to minimize them.
The usual boot parameters "nohz_full=" or "isolcpus=nohz" will now
outsource these scheduler ticks to the global workqueue so that a
housekeeping CPU handles those remotely. The sched_class::task_tick()
implementations have been audited and look safe to be called remotely
as the target runqueue and its current task are passed in parameter
and don't seem to be accessed locally.
Note that in the case of using isolcpus, it's still up to the user to
affine the global workqueues to the housekeeping CPUs through
/sys/devices/virtual/workqueue/cpumask or domains isolation
"isolcpus=nohz,domain".
Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Cc: Chris Metcalf <cmetcalf@mellanox.com>
Cc: Christoph Lameter <cl@linux.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Luiz Capitulino <lcapitulino@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Wanpeng Li <kernellwp@gmail.com>
Link: http://lkml.kernel.org/r/1519186649-3242-6-git-send-email-frederic@kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/sched/fair.c')
-rw-r--r-- | kernel/sched/fair.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 33662a3bdc6d..e1febd252a84 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -9515,7 +9515,12 @@ static void rq_offline_fair(struct rq *rq) #endif /* CONFIG_SMP */ /* - * scheduler tick hitting a task of our scheduling class: + * scheduler tick hitting a task of our scheduling class. + * + * NOTE: This function can be called remotely by the tick offload that + * goes along full dynticks. Therefore no local assumption can be made + * and everything must be accessed through the @rq and @curr passed in + * parameters. */ static void task_tick_fair(struct rq *rq, struct task_struct *curr, int queued) { |