Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933743AbcIAPFf (ORCPT ); Thu, 1 Sep 2016 11:05:35 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:33235 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933143AbcIAPF3 (ORCPT ); Thu, 1 Sep 2016 11:05:29 -0400 From: Manfred Spraul To: benh@kernel.crashing.org, paulmck@linux.vnet.ibm.com, Ingo Molnar , Boqun Feng , Peter Zijlstra , Andrew Morton Cc: LKML , will.deacon@arm.com, 1vier1@web.de, Davidlohr Bueso , Manfred Spraul Subject: [PATCH 3/7] ipc/sem.c: Rely on spin_unlock_wait() = spin_lock();spin_unlock(). Date: Thu, 1 Sep 2016 17:04:13 +0200 Message-Id: <1472742257-10515-4-git-send-email-manfred@colorfullife.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1472742257-10515-1-git-send-email-manfred@colorfullife.com> References: <1472742257-10515-1-git-send-email-manfred@colorfullife.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org >From memory ordering point of view, spin_unlock_wait() provides the same guarantees as spin_lock(); spin_unlock(). Therefore the smp_mb() after spin_lock() is not necessary, spin_unlock_wait() must provide the memory ordering. Signed-off-by: Manfred Spraul Cc: Will Deacon --- ipc/sem.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/ipc/sem.c b/ipc/sem.c index 6586e0a..a5da82c 100644 --- a/ipc/sem.c +++ b/ipc/sem.c @@ -355,14 +355,6 @@ static inline int sem_lock(struct sem_array *sma, struct sembuf *sops, */ spin_lock(&sem->lock); - /* - * See 51d7d5205d33 - * ("powerpc: Add smp_mb() to arch_spin_is_locked()"): - * A full barrier is required: the write of sem->lock - * must be visible before the read is executed - */ - smp_mb(); - if (!smp_load_acquire(&sma->complex_mode)) { /* fast path successful! */ return sops->sem_num; -- 2.7.4