Skip to content

Commit

Permalink
posix-timers: Spare workqueue if there is no full dynticks CPU to kick
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Frederic Weisbecker committed Dec 2, 2013
1 parent d0df09e commit d4283c6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion kernel/posix-cpu-timers.c
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,8 @@ static DECLARE_WORK(nohz_kick_work, nohz_kick_work_fn);
*/
static void posix_cpu_timer_kick_nohz(void)
{
schedule_work(&nohz_kick_work);
if (context_tracking_is_enabled())
schedule_work(&nohz_kick_work);
}

bool posix_cpu_timers_can_stop_tick(struct task_struct *tsk)
Expand Down

0 comments on commit d4283c6

Please sign in to comment.