Re: [PATCH -v3 3/8] locking: Introduce smp_acquire__after_ctrl_dep
From: Boqun Feng
Date: Wed Jun 01 2016 - 09:48:45 EST
On Tue, May 31, 2016 at 11:41:37AM +0200, Peter Zijlstra wrote:
[snip]
> @@ -260,16 +260,6 @@ static void sem_rcu_free(struct rcu_head
> }
>
> /*
> - * spin_unlock_wait() and !spin_is_locked() are not memory barriers, they
> - * are only control barriers.
> - * The code must pair with spin_unlock(&sem->lock) or
> - * spin_unlock(&sem_perm.lock), thus just the control barrier is insufficient.
> - *
> - * smp_rmb() is sufficient, as writes cannot pass the control barrier.
> - */
> -#define ipc_smp_acquire__after_spin_is_unlocked() smp_rmb()
> -
> -/*
> * Wait until all currently ongoing simple ops have completed.
> * Caller must own sem_perm.lock.
> * New simple ops cannot start, because simple ops first check
> @@ -292,7 +282,7 @@ static void sem_wait_array(struct sem_ar
> sem = sma->sem_base + i;
> spin_unlock_wait(&sem->lock);
> }
> - ipc_smp_acquire__after_spin_is_unlocked();
> + smp_acquire__after_ctrl_dep();
I wonder whether we can kill this barrier after updating
spin_unlock_wait() to ACQUIRE?
Regards,
Boqun
> }
>
> /*
Attachment:
signature.asc
Description: PGP signature