lkml.org 
[lkml]   [2015]   [Mar]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] ipc/sem.c: Update/correct memory barriers
Manfred,

I leave this to you and Paul/Peter, but...

On 03/01, Manfred Spraul wrote:
>
> +/*
> + * spin_unlock_wait() and !spin_is_locked() are not memory barriers, they
> + * are only control barriers, thus a memory barrier is required if the
> + * operation should act as an acquire memory barrier, i.e. if it should
> + * pair with the release memory barrier from the spin_unlock() that released
> + * the spinlock.
> + * smp_rmb() is sufficient, as writes cannot pass the implicit control barrier.
> + */
> +#ifndef smp_acquire__after_spin_unlock_wait
> +#define smp_acquire__after_spin_unlock_wait() smp_rmb()
> +#endif
> +#ifndef smp_acquire__after_spin_is_unlocked
> +#define smp_acquire__after_spin_is_unlocked() smp_rmb()
> +#endif

But spin_unlock_wait() and spin_is_locked() is the "same thing" when it
comes to serialization with spin_unlock()... Not sure we need 2 helpers.

But I won't argue of course.

Oleg.



\
 
 \ /
  Last update: 2015-03-01 20:21    [W:0.031 / U:0.320 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site