summaryrefslogtreecommitdiffstats
path: root/kernel/time/timer.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2015-04-14 21:09:25 +0000
committerThomas Gleixner <tglx@linutronix.de>2015-04-22 17:06:52 +0200
commit19d9f4225dd6a47fca430f15eeae345ceb95c301 (patch)
treef90969148ac0bb48b93322ee35a8aa3a5780f22f /kernel/time/timer.c
parent61699e13072a89880aa584dcc64c6da465fb2ccc (diff)
downloadop-kernel-dev-19d9f4225dd6a47fca430f15eeae345ceb95c301.zip
op-kernel-dev-19d9f4225dd6a47fca430f15eeae345ceb95c301.tar.gz
hrtimer: Avoid locking in hrtimer_cancel() if timer not active
We can do a lockless check for hrtimer_active before actually taking the lock in hrtimer[_try_to]_cancel. This is useful for hotpath users like nanosleep as they avoid the lock dance when the timer has expired. This is safe because active is true when the timer is enqueued or the callback is running. Taking the hrtimer base lock does not protect against concurrent hrtimer_start calls, the callsite has to do the proper serialization itself. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Peter Zijlstra <peterz@infradead.org> Cc: Preeti U Murthy <preeti@linux.vnet.ibm.com> Cc: Viresh Kumar <viresh.kumar@linaro.org> Cc: Marcelo Tosatti <mtosatti@redhat.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Link: http://lkml.kernel.org/r/20150414203503.580273114@linutronix.de Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel/time/timer.c')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud