From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935743AbdCWSWQ (ORCPT ); Thu, 23 Mar 2017 14:22:16 -0400 Received: from terminus.zytor.com ([65.50.211.136]:42935 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933773AbdCWSWP (ORCPT ); Thu, 23 Mar 2017 14:22:15 -0400 Date: Thu, 23 Mar 2017 11:19:43 -0700 From: tip-bot for Peter Zijlstra Message-ID: Cc: peterz@infradead.org, mingo@kernel.org, linux-kernel@vger.kernel.org, hpa@zytor.com, tglx@linutronix.de Reply-To: tglx@linutronix.de, hpa@zytor.com, mingo@kernel.org, linux-kernel@vger.kernel.org, peterz@infradead.org In-Reply-To: <20170322104151.604296452@infradead.org> References: <20170322104151.604296452@infradead.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:locking/core] futex: Use smp_store_release() in mark_wake_futex() Git-Commit-ID: 1b367ece0d7e696cab1c8501bab282cc6a538b3f 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: 1b367ece0d7e696cab1c8501bab282cc6a538b3f Gitweb: http://git.kernel.org/tip/1b367ece0d7e696cab1c8501bab282cc6a538b3f Author: Peter Zijlstra AuthorDate: Wed, 22 Mar 2017 11:35:49 +0100 Committer: Thomas Gleixner CommitDate: Thu, 23 Mar 2017 19:10:06 +0100 futex: Use smp_store_release() in mark_wake_futex() Since the futex_q can dissapear the instruction after assigning NULL, this really should be a RELEASE barrier. That stops loads from hitting dead memory too. Signed-off-by: Peter Zijlstra (Intel) Cc: juri.lelli@arm.com Cc: bigeasy@linutronix.de Cc: xlpang@redhat.com Cc: rostedt@goodmis.org Cc: mathieu.desnoyers@efficios.com Cc: jdesfossez@efficios.com Cc: dvhart@infradead.org Cc: bristot@redhat.com Link: http://lkml.kernel.org/r/20170322104151.604296452@infradead.org Signed-off-by: Thomas Gleixner --- kernel/futex.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/kernel/futex.c b/kernel/futex.c index 1531cc4..cc10340 100644 --- a/kernel/futex.c +++ b/kernel/futex.c @@ -1290,8 +1290,7 @@ static void mark_wake_futex(struct wake_q_head *wake_q, struct futex_q *q) * memory barrier is required here to prevent the following * store to lock_ptr from getting ahead of the plist_del. */ - smp_wmb(); - q->lock_ptr = NULL; + smp_store_release(&q->lock_ptr, NULL); } static int wake_futex_pi(u32 __user *uaddr, u32 uval, struct futex_q *top_waiter,