From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1426085AbcFHO1t (ORCPT ); Wed, 8 Jun 2016 10:27:49 -0400 Received: from terminus.zytor.com ([198.137.202.10]:34732 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1423094AbcFHO1r (ORCPT ); Wed, 8 Jun 2016 10:27:47 -0400 Date: Wed, 8 Jun 2016 07:27:14 -0700 From: tip-bot for Pan Xinhui Message-ID: Cc: tglx@linutronix.de, xinhui.pan@linux.vnet.ibm.com, mingo@kernel.org, torvalds@linux-foundation.org, paulmck@linux.vnet.ibm.com, akpm@linux-foundation.org, peterz@infradead.org, linux-kernel@vger.kernel.org, hpa@zytor.com Reply-To: paulmck@linux.vnet.ibm.com, torvalds@linux-foundation.org, mingo@kernel.org, xinhui.pan@linux.vnet.ibm.com, tglx@linutronix.de, hpa@zytor.com, linux-kernel@vger.kernel.org, peterz@infradead.org, akpm@linux-foundation.org In-Reply-To: <1464943094-3129-1-git-send-email-xinhui.pan@linux.vnet.ibm.com> References: <1464943094-3129-1-git-send-email-xinhui.pan@linux.vnet.ibm.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:locking/core] locking/qspinlock: Use atomic_sub_return_release() in queued_spin_unlock() Git-Commit-ID: ca50e426f96c905e7d14a9c7a6bd4e0330516047 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: ca50e426f96c905e7d14a9c7a6bd4e0330516047 Gitweb: http://git.kernel.org/tip/ca50e426f96c905e7d14a9c7a6bd4e0330516047 Author: Pan Xinhui AuthorDate: Fri, 3 Jun 2016 16:38:14 +0800 Committer: Ingo Molnar CommitDate: Wed, 8 Jun 2016 15:17:01 +0200 locking/qspinlock: Use atomic_sub_return_release() in queued_spin_unlock() The existing version uses a heavy barrier while only release semantics is required. So use atomic_sub_return_release() instead. Suggested-by: Peter Zijlstra (Intel) Signed-off-by: Pan Xinhui Signed-off-by: Peter Zijlstra (Intel) Cc: Andrew Morton Cc: Linus Torvalds Cc: Paul E. McKenney Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: arnd@arndb.de Cc: waiman.long@hp.com Link: http://lkml.kernel.org/r/1464943094-3129-1-git-send-email-xinhui.pan@linux.vnet.ibm.com Signed-off-by: Ingo Molnar --- include/asm-generic/qspinlock.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/include/asm-generic/qspinlock.h b/include/asm-generic/qspinlock.h index 05f05f1..9f0681b 100644 --- a/include/asm-generic/qspinlock.h +++ b/include/asm-generic/qspinlock.h @@ -111,10 +111,9 @@ static __always_inline void queued_spin_lock(struct qspinlock *lock) static __always_inline void queued_spin_unlock(struct qspinlock *lock) { /* - * smp_mb__before_atomic() in order to guarantee release semantics + * unlock() needs release semantics: */ - smp_mb__before_atomic(); - atomic_sub(_Q_LOCKED_VAL, &lock->val); + (void)atomic_sub_return_release(_Q_LOCKED_VAL, &lock->val); } #endif