aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/posix-cpu-timers.c
diff options
context:
space:
mode:
authorFrederic Weisbecker <fweisbec@gmail.com>2013-11-06 09:42:04 -0500
committerFrederic Weisbecker <fweisbec@gmail.com>2013-12-02 14:43:16 -0500
commitd4283c654130c3d01b6842d3821dbdc3c15ceb46 (patch)
tree2fa770f2500b88bb42ebcb2bfcde4a738049638f /kernel/posix-cpu-timers.c
parentd0df09ebfc126b23c1005f98ddecc9907f9c5d25 (diff)
posix-timers: Spare workqueue if there is no full dynticks CPU to kick
After a posix cpu timer is set, a workqueue is scheduled in order to kick the full dynticks CPUs and let them restart their tick if necessary in case the task they are running is concerned by the new timer. This kick is implemented by way of IPIs, which require interrupts to be enabled, hence the need for a workqueue to raise them because the posix cpu timer set path has interrupts disabled. Now if there is no full dynticks CPU on the system, the workqueue is still scheduled but it simply won't send any IPI and return immediately. So lets spare that worqueue when it is not needed. Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Ingo Molnar <mingo@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'kernel/posix-cpu-timers.c')
-rw-r--r--kernel/posix-cpu-timers.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/posix-cpu-timers.c b/kernel/posix-cpu-timers.c
index c7f31aa272f7..35509c5a3ffb 100644
--- a/kernel/posix-cpu-timers.c
+++ b/kernel/posix-cpu-timers.c
@@ -608,7 +608,8 @@ static DECLARE_WORK(nohz_kick_work, nohz_kick_work_fn);
608 */ 608 */
609static void posix_cpu_timer_kick_nohz(void) 609static void posix_cpu_timer_kick_nohz(void)
610{ 610{
611 schedule_work(&nohz_kick_work); 611 if (context_tracking_is_enabled())
612 schedule_work(&nohz_kick_work);
612} 613}
613 614
614bool posix_cpu_timers_can_stop_tick(struct task_struct *tsk) 615bool posix_cpu_timers_can_stop_tick(struct task_struct *tsk)