From: tip-bot for Davidlohr Bueso <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: mingo@kernel.org, linux-kernel@vger.kernel.org,
dave@stgolabs.net, dbueso@suse.de, hpa@zytor.com,
peterz@infradead.org, tglx@linutronix.de
Subject: [tip:locking/urgent] futex: Fix barrier comment
Date: Fri, 8 Feb 2019 04:04:48 -0800 [thread overview]
Message-ID: <tip-6f568ebe2afefdc33a6fb06ef20a94f8b96455f1@git.kernel.org> (raw)
In-Reply-To: <20190206185602.949-1-dave@stgolabs.net>
Commit-ID: 6f568ebe2afefdc33a6fb06ef20a94f8b96455f1
Gitweb: https://git.kernel.org/tip/6f568ebe2afefdc33a6fb06ef20a94f8b96455f1
Author: Davidlohr Bueso <dave@stgolabs.net>
AuthorDate: Wed, 6 Feb 2019 10:56:02 -0800
Committer: Thomas Gleixner <tglx@linutronix.de>
CommitDate: Fri, 8 Feb 2019 13:00:35 +0100
futex: Fix barrier comment
The current comment for the barrier that guarantees that waiter increment
is always before taking the hb spinlock (barrier (A)) needs to be fixed as
it is misplaced.
This is obviously referring to hb_waiters_inc, which is a full barrier.
Reported-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Davidlohr Bueso <dbueso@suse.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lkml.kernel.org/r/20190206185602.949-1-dave@stgolabs.net
---
kernel/futex.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/futex.c b/kernel/futex.c
index fdd312da0992..5ec2473a3497 100644
--- a/kernel/futex.c
+++ b/kernel/futex.c
@@ -2221,11 +2221,11 @@ static inline struct futex_hash_bucket *queue_lock(struct futex_q *q)
* decrement the counter at queue_unlock() when some error has
* occurred and we don't end up adding the task to the list.
*/
- hb_waiters_inc(hb);
+ hb_waiters_inc(hb); /* implies smp_mb(); (A) */
q->lock_ptr = &hb->lock;
- spin_lock(&hb->lock); /* implies smp_mb(); (A) */
+ spin_lock(&hb->lock);
return hb;
}
prev parent reply other threads:[~2019-02-08 12:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-06 18:56 [PATCH] kernel/futex: Fix barrier comment Davidlohr Bueso
2019-02-08 12:04 ` tip-bot for Davidlohr Bueso [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tip-6f568ebe2afefdc33a6fb06ef20a94f8b96455f1@git.kernel.org \
--to=tipbot@zytor.com \
--cc=dave@stgolabs.net \
--cc=dbueso@suse.de \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox