History

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.

Thomas Gleixner committed 7 years ago

Commit 60bda031 parent 244d49e3 files · +155 −109Browse files

Showing the changes to include/linux/timerqueue.h (1 of 3 files). Show all

Unified · Split

include/linux/timerqueue.h+10−0
@@ -43,6 +43,16 @@ static inline void timerqueue_init(struct timerqueue_node *node) · 42 unmodified lines
43 RB_CLEAR_NODE(&node->node);43 RB_CLEAR_NODE(&node->node);
44}44}
45 45
46static inline bool timerqueue_node_queued(struct timerqueue_node *node)
47{
48 return !RB_EMPTY_NODE(&node->node);
49}
50
51static inline bool timerqueue_node_expires(struct timerqueue_node *node)
52{
53 return node->expires;
54}
55
46static inline void timerqueue_init_head(struct timerqueue_head *head)56static inline void timerqueue_init_head(struct timerqueue_head *head)
47{57{
48 head->rb_root = RB_ROOT_CACHED;58 head->rb_root = RB_ROOT_CACHED;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t