Re: [patch] Real-Time Preemption, -RT-2.6.12-rc4-V0.7.47-06

Daniel Walker
2005-05-23T15:12:36Z

On Mon, 23 May 2005, Oleg Nesterov wrote:

> So the very first node will be skipped, iteration will be out of order,
> and you will have the plist's *head* as a last element (which is not
> struct rt_mutex_waiter, of course).

True, but the first node is the list head which must be static,
It's not an actual list member.

> > unsigned plist_empty(const struct plist *plist)
> > {
> > - return list_empty (&plist->dp_node);
> > + return list_empty(&plist->dp_node) && list_empty(&plist->sp_node);
> > }
>
> It's enough to check list_empty(&plist->sp_node) only.

True.

> new_sp_head:
> itr_pl2 = container_of(itr_pl->dp_node.prev, struct plist, dp_node);
> list_add(&pl->sp_node, &itr_pl2->sp_node);
>
> Why? Just list_add_tail(&pl->sp_node, itr_pl->sp_node), you don't
> need itr_pl2 at all.

Wouldn't work . What if itr_pl has 15 elements at it's priority?

> Daniel, if you accepted all-nodes-tied-via-sp_node idea, could you
> also look at the code I've suggested. I think it is much simpler
> and understandable.

I will/have. The sp_node all connect idea came from your stuff.

> Personally, I think it is better to have pl_head for plist's head,
> and pl_node for nodes. It is pointless to store ->prio in the plist's
> head, it can be found in plist_first()->prio. This way we can trim
> the size of rt_mutex to 32 bytes, and it is good for typechecking.

I like that idea, I just haven't done it yet.

Daniel