diff options
| author | Peter Zijlstra <[email protected]> | 2020-04-29 15:03:22 +0000 |
|---|---|---|
| committer | Ingo Molnar <[email protected]> | 2021-02-17 13:07:31 +0000 |
| commit | 2d24dd5798d0474d9bf705bfca8725e7d20f9d54 (patch) | |
| tree | 895ec9efd5a44987e173310f228135fbeb28b17b /lib/timerqueue.c | |
| parent | sched/fair: Merge select_idle_core/cpu() (diff) | |
| download | kernel-2d24dd5798d0474d9bf705bfca8725e7d20f9d54.tar.gz kernel-2d24dd5798d0474d9bf705bfca8725e7d20f9d54.zip | |
rbtree: Add generic add and find helpers
I've always been bothered by the endless (fragile) boilerplate for
rbtree, and I recently wrote some rbtree helpers for objtool and
figured I should lift them into the kernel and use them more widely.
Provide:
partial-order; less() based:
- rb_add(): add a new entry to the rbtree
- rb_add_cached(): like rb_add(), but for a rb_root_cached
total-order; cmp() based:
- rb_find(): find an entry in an rbtree
- rb_find_add(): find an entry, and add if not found
- rb_find_first(): find the first (leftmost) matching entry
- rb_next_match(): continue from rb_find_first()
- rb_for_each(): iterate a sub-tree using the previous two
Inlining and constant propagation should see the compiler inline the
whole thing, including the various compare functions.
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
Reviewed-by: Michel Lespinasse <[email protected]>
Acked-by: Davidlohr Bueso <[email protected]>
Diffstat (limited to 'lib/timerqueue.c')
0 files changed, 0 insertions, 0 deletions
