OSDN Git Service

posix-cpu-timers: Utilize timerqueue for storage
authorThomas Gleixner <tglx@linutronix.de>
Tue, 27 Aug 2019 19:31:02 +0000 (21:31 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Wed, 28 Aug 2019 09:50:43 +0000 (11:50 +0200)
commit60bda037f1dd8151e0c9ee5b09f0c091a0f643cd
treeac8ed446c0ae7fcdf72285d5ca99531a3f96560b
parent244d49e30653658d4e7e9b2b8427777cbbc5affe
posix-cpu-timers: Utilize timerqueue for storage

Using a linear O(N) search for timer insertion affects execution time and
D-cache footprint badly with a larger number of timers.

Switch the storage to a timerqueue which is already used for hrtimers and
alarmtimers. It does not affect the size of struct k_itimer as it.alarm is
still larger.

The extra list head for the expiry list will go away later once the expiry
is moved into task work context.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Frederic Weisbecker <frederic@kernel.org>
Link: https://lkml.kernel.org/r/alpine.DEB.2.21.1908272129220.1939@nanos.tec.linutronix.de
include/linux/posix-timers.h
include/linux/timerqueue.h
kernel/time/posix-cpu-timers.c