On Tue, 2008-09-02 at 10:22 +0200, Peter Zijlstra wrote:
What you need is a data structure that supports stabbing queries on
overlapping intervals, such like a Priority Search Tree.
If I'm not mistaken, then the augmented Red-Black tree from the EEVDF
paper is identical to PST [*].
This data-structure adds a Heap property to each RB-node, allowing one
to search the tree on a different property.
So what you can do in this case, is index the RB-tree on the soft
expire, and index the heap on the hard expire.
Then you can find the leftmost hard expire by traversing the tree using
the heap property - and program the clock-event using that time.
And you can search for soft expired entries using the RB-tree like we do
now.
[*] Fabio implemented it on top of the linux RB-tree for their wf2q+
implementation that they used for their BFQ I/O scheduler:
http://feanor.sssup.it/~fabio/linux/wfq/
And I borrowed their implementation for my scheduler work:
http://programming.kicks-ass.net/kernel-patches/sched-eevdf/sched-eedf.patch
--