timers: Reduce __run_timers() latency for empty list
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Mon, 16 Dec 2013 13:57:10 +0000 (05:57 -0800)
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Tue, 25 Feb 2014 20:39:00 +0000 (12:39 -0800)
commitd550e81dc0ddc04f1b417c179c214103a28e0ee8
treea873c6b1a980500c59af7b194374d604e3dba1eb
parentfff421580f512fc044cc7421fdff31a7a6997350
timers: Reduce __run_timers() latency for empty list

The __run_timers() function currently steps through the list one jiffy at
a time in order to update the timer wheel.  However, if the timer wheel
is empty, no adjustment is needed other than updating ->timer_jiffies.
In this case, which is likely to be common for NO_HZ_FULL kernels, the
kernel currently incurs a large latency for no good reason.  This commit
therefore short-circuits this case.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Reviewed-by: Oleg Nesterov <oleg@redhat.com>
Reviewed-by: Steven Rostedt <rostedt@goodmis.org>
Tested-by: Mike Galbraith <bitbucket@online.de>
kernel/timer.c