Messages in this thread | | | Date | Sun, 1 Mar 2015 20:16:46 +0100 | From | Oleg Nesterov <> | Subject | Re: [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.
| |