diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2016-10-24 11:55:10 +0200 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2016-10-25 16:27:39 +0200 |
commit | 4da9152a4308dcbf611cde399c695c359fc9145f (patch) | |
tree | ef634a7c192d03dd1f04b82f20ef58e78b55b3be /Documentation | |
parent | b831275a3553c32091222ac619cfddd73a5553fb (diff) |
timers: Lock base for same bucket optimization
Linus stumbled over the unlocked modification of the timer expiry value in
mod_timer() which is an optimization for timers which stay in the same
bucket - due to the bucket granularity - despite their expiry time getting
updated.
The optimization itself still makes sense even if we take the lock, because
in case that the bucket stays the same, we avoid the pointless
queue/enqueue dance.
Make the check and the modification of timer->expires protected by the base
lock and shuffle the remaining code around so we can keep the lock held
when we actually have to requeue the timer to a different bucket.
Fixes: f00c0afdfa62 ("timers: Implement optimization for same expiry time in mod_timer()")
Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/alpine.DEB.2.20.1610241711220.4983@nanos
Cc: stable@vger.kernel.org
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Diffstat (limited to 'Documentation')
0 files changed, 0 insertions, 0 deletions