]> git.baikalelectronics.ru Git - kernel.git/commit
hrtimer: Switch 'for' loop to _ffs() evaluation
authorAnna-Maria Gleixner <anna-maria@linutronix.de>
Thu, 21 Dec 2017 10:41:39 +0000 (11:41 +0100)
committerIngo Molnar <mingo@kernel.org>
Tue, 16 Jan 2018 01:35:46 +0000 (02:35 +0100)
commitc272ca58c3ec5631f4ab507489d9477f74efe645
treee117843b4055a931b4973dbf270f3a16b07b6f32
parent63e2ed3659752a4850e0ef3a07f809988fcd74a4
hrtimer: Switch 'for' loop to _ffs() evaluation

Looping over all clock bases to find active bits is suboptimal if not all
bases are active.

Avoid this by converting it to a __ffs() evaluation. The functionallity is
outsourced into its own function and is called via a macro as suggested by
Peter Zijlstra.

Suggested-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de>
Cc: Christoph Hellwig <hch@lst.de>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: keescook@chromium.org
Link: http://lkml.kernel.org/r/20171221104205.7269-11-anna-maria@linutronix.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
kernel/time/hrtimer.c