Re: Comment on 2.6.16-rt6 PI

From: Esben Nielsen
Date: Sat Mar 25 2006 - 13:20:45 EST


On Sat, 25 Mar 2006, Thomas Gleixner wrote:

> On Sat, 2006-03-25 at 14:52 +0100, Esben Nielsen wrote:
>
> > In my test setup this leaves the owner->pi_waiters empty even though there
> > are waiters. I tried to move the removal of top_waiter inside the second
> > if statement but then a lot of other tests failed. I don't have time to
> > fix it.
>
> Can you please explain that more detailed how it happens ? And provide a
> test case ?
>

Sorry for the lack of details. I just thought the test-case wouldn't make
sense to you much and didn't paste it in. I was in a bit of a hurry too.
Now I have a little more time and can tell you what is going on:

top_waiter!=NULL
waiter!=NULL
waiter!=rt_mutex_top_waiter(lock)

Therefore one top_waiter is removed and but nothing is inserted.

Below is a fix.

Esben

> tglx
>
>
--- linux-2.6.16-rt6/kernel/rtmutex.c.orig 2006-03-25 19:14:35.000000000 +0100
+++ linux-2.6.16-rt6/kernel/rtmutex.c 2006-03-25 19:22:04.000000000 +0100
@@ -223,15 +223,22 @@ static void adjust_pi_chain(struct rt_mu
struct list_head *curr = lock_chain->prev;

for (;;) {
- if (top_waiter)
+ if (top_waiter) {
plist_del(&top_waiter->pi_list_entry,
&owner->pi_waiters);
-
-
- if (waiter && waiter == rt_mutex_top_waiter(lock)) {
+ }
+
+ if (waiter) {
waiter->pi_list_entry.prio = waiter->task->prio;
- plist_add(&waiter->pi_list_entry, &owner->pi_waiters);
}
+
+ if (rt_mutex_has_waiters(lock)) {
+ top_waiter = rt_mutex_top_waiter(lock);
+ plist_add(&top_waiter->pi_list_entry,
+ &owner->pi_waiters);
+ }
+
+
adjust_prio(owner);

waiter = owner->pi_blocked_on;

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/