mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 20:51:03 +02:00
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
This commit is contained in:
@@ -43,6 +43,16 @@ static inline void timerqueue_init(struct timerqueue_node *node)
|
||||
RB_CLEAR_NODE(&node->node);
|
||||
}
|
||||
|
||||
static inline bool timerqueue_node_queued(struct timerqueue_node *node)
|
||||
{
|
||||
return !RB_EMPTY_NODE(&node->node);
|
||||
}
|
||||
|
||||
static inline bool timerqueue_node_expires(struct timerqueue_node *node)
|
||||
{
|
||||
return node->expires;
|
||||
}
|
||||
|
||||
static inline void timerqueue_init_head(struct timerqueue_head *head)
|
||||
{
|
||||
head->rb_root = RB_ROOT_CACHED;
|
||||
|
Reference in New Issue
Block a user