* Steven Rostedt <[EMAIL PROTECTED]> wrote:

>       while(unlikely(error == IN_WAKEUP)) {
>               cpu_relax();
>               error = queue.status;
>       }
> 
> So, what looks to be happening is that as soon as the parent wakes up
> the child, the child preempts the parent, and hits this while loop.
> But since the child is a realtime task, with the highest priority of
> the system, it starves the system. Of course this is a UP and I don't
> think this will show a problem on an SMP machine. 

hm - i had a fix in this area in the -V0.7 series. Then i thought this
is a performance fix only and dropped it eventually, but could you give
it a go - does it fix the deadlock?

        Ingo

--- linux/ipc/sem.c.orig
+++ linux/ipc/sem.c
@@ -359,12 +371,18 @@ static void update_queue (struct sem_arr
                        struct sem_queue *n;
                        remove_from_queue(sma,q);
                        n = q->next;
+                       /*
+                        * Make sure that the wakeup doesnt preempt
+                        * _this_ CPU prematurely. (on PREEMPT_RT)
+                        */
+                       preempt_disable();
                        q->status = IN_WAKEUP;
                        wake_up_process(q->sleeper);
                        /* hands-off: q will disappear immediately after
                         * writing q->status.
                         */
                        q->status = error;
+                       preempt_enable();
                        q = n;
                } else {
                        q = q->next;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to