Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933810AbcIAPFh (ORCPT ); Thu, 1 Sep 2016 11:05:37 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:35922 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933061AbcIAPF3 (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 1/7] ipc/sem.c: Remove smp_rmb() from complexmode_enter() Date: Thu, 1 Sep 2016 17:04:11 +0200 Message-Id: <1472742257-10515-2-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 complexmode_enter() contains an smp_rmb() after spin_unlock_wait(). This was done to allow safe backporting. Commit 2c6100227116 ("locking/qspinlock: Fix spin_unlock_wait() some more") (and the commits for the other archs) ensure that spin_unlock_wait() is an ACQUIRE. Therefore the smp_rmb() after spin_unlock_wait() can be removed. Not for stable! Signed-off-by: Manfred Spraul --- ipc/sem.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/ipc/sem.c b/ipc/sem.c index 5e318c5..6586e0a 100644 --- a/ipc/sem.c +++ b/ipc/sem.c @@ -290,14 +290,6 @@ static void complexmode_enter(struct sem_array *sma) sem = sma->sem_base + i; spin_unlock_wait(&sem->lock); } - /* - * spin_unlock_wait() is not a memory barriers, it is only a - * control barrier. The code must pair with spin_unlock(&sem->lock), - * thus just the control barrier is insufficient. - * - * smp_rmb() is sufficient, as writes cannot pass the control barrier. - */ - smp_rmb(); } /* -- 2.7.4