On Sat, 2005-02-05 at 08:59 +0100, Ingo Molnar wrote:

> 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

Yep, it worked! I tried a similar fix earlier but I put the preempt
disable before the setting of q->status (duh!) and it didn't work. But
it was late and I was tired of looking at it.  I was about to say that I
already tried it, but then noticed the placement of preempt_disable, and
thought, I better try yours anyway. Well, it seems to fix it. By the
way, I just put in the disable and enable in -37. I haven't gotten to
your 38 yet, but this fixed 37.

Thanks,

-- Steve

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