Re: Comment on 2.6.16-rt6 PI

From: Esben Nielsen
Date: Sat Mar 25 2006 - 14:49:17 EST


On Sat, 25 Mar 2006, Thomas Gleixner wrote:

> On Sat, 2006-03-25 at 19:23 +0100, Esben Nielsen wrote:
> > 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.
>
> How does this happen. From inside the loop this is impossible. And I
> dont see a caller with that constellation either.

The test-case where I made it happen is below.

What happens in the last line of execution is that the 3rd thread takes
lock 1 and boosts task 1st task which is blocked on 2nd task. Now all 1st,
2nd and 3rd task all have priority 1.
Then the 4th task is allowed to run. It tries to lock lock 2, which is owned
by the 2nd task. The first waiter is the 1st task bosted to priorty 2. So
this is "top_waiter". But waiter referes to the 4th task with priority 2
so not the first waiter.

The result is as above because I am running with deadlock detection on.

Esben


threads: 4 3 1 2
lock 1 + + +
test: + + + +
test: prio 4 prio 3 prio 1 prio 2
test: lockcount 1 lockcount 0 lockcount 0 lockcount 0

+ lock 2 + +
test: + + + +
test: prio 4 prio 3 prio 1 prio 2
test: lockcount 1 lockcount 1 lockcount 0 lockcount 0

lock 2 + + +
test: - + + +
test: prio 4 prio 3 prio 1 prio 2
test: lockcount 1 lockcount 1 lockcount 0 lockcount 0

+ + lock1 lock 2
test: - + - -
test: prio 1 prio 1 prio 1 prio 2
test: lockcount 1 lockcount 1 lockcount 0 lockcount 0

>
> tglx
>
>
> -
> 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/
>

-
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/