On Sun, 2010-02-28 at 20:26 +0100, Raistlin wrote:
Right, except that this makes the plist stuff O(INT_MAX) [ or rather
O(nr_dl_tasks) ].
But I guess it serves for testing.
I think it would be relatively straight forward to modify the existing
PI chain code to work using an RB-tree instead of the plist stuff.
An RB-tree would also make the whole ->prio mess much easier to solve,
we could simply make a more complex comparison function, like:
int rt_mutex_prio_less(struct task_struct *left, struct task_struct *right)
{
if (left->prio < right->prio)
return 1;
if (left->prio == right->prio && left->prio == -1) {
if (left->deadline < right->deadline)
return 1;
}
return 0;
}
Which uses the static prio -1 to represent all deadline tasks.
Yeah, good enough to start with ;-)
--