Re: [PATCH] bug in futex unqueue_me

From: Ingo Molnar
Date: Mon Jul 31 2006 - 07:59:42 EST



* Christian Borntraeger <borntrae@xxxxxxxxxx> wrote:

> On Sunday 30 July 2006 08:38, Ingo Molnar wrote:
> > interesting, how is this possible? We do a spin_lock(lock_ptr), and
> > taking a spinlock is an implicit barrier(). So gcc must not delay
> > evaluating lock_ptr to inside the critical section. And as far as i can
> > see the s390 spinlock implementation goes through an 'asm volatile'
> > piece of code, which is a barrier already. So how could this have
> > happened?
>
> spin_lock is a barrier, but isnt the barrierness too late here? The
> compiler reloads the value of lock_ptr after the "if(lock_ptr)" and
> *before* calling spin_lock(lock_ptr):

ah, indeed. So your patch is a real fix. Thanks,

Acked-by: Ingo Molnar <mingo@xxxxxxx>

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