From: "tip-bot2 for Davidlohr Bueso" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Davidlohr Bueso <dbueso@suse.de>,
Thomas Gleixner <tglx@linutronix.de>,
"Peter Zijlstra (Intel)" <peterz@infradead.org>,
x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: locking/core] kernel/futex: Make futex_wait_requeue_pi() only call fixup_owner()
Date: Thu, 11 Mar 2021 18:24:55 -0000 [thread overview]
Message-ID: <161548709514.398.3019777443206037709.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20210226175029.50335-2-dave@stgolabs.net>
The following commit has been merged into the locking/core branch of tip:
Commit-ID: a1565aa4699847febfdfd6af3bf06ca17a9e16af
Gitweb: https://git.kernel.org/tip/a1565aa4699847febfdfd6af3bf06ca17a9e16af
Author: Davidlohr Bueso <dave@stgolabs.net>
AuthorDate: Fri, 26 Feb 2021 09:50:27 -08:00
Committer: Thomas Gleixner <tglx@linutronix.de>
CommitterDate: Thu, 11 Mar 2021 19:19:17 +01:00
kernel/futex: Make futex_wait_requeue_pi() only call fixup_owner()
A small cleanup that allows for fixup_pi_state_owner() only to be called
from fixup_owner(), and make requeue_pi uniformly call fixup_owner()
regardless of the state in which the fixup is actually needed. Of course
this makes the caller's first pi_state->owner != current check redundant,
but that should't really matter.
Signed-off-by: Davidlohr Bueso <dbueso@suse.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/r/20210226175029.50335-2-dave@stgolabs.net
---
kernel/futex.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/kernel/futex.c b/kernel/futex.c
index db8002d..ee09995 100644
--- a/kernel/futex.c
+++ b/kernel/futex.c
@@ -3241,15 +3241,14 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags,
* reference count.
*/
- /* Check if the requeue code acquired the second futex for us. */
+ /*
+ * Check if the requeue code acquired the second futex for us and do
+ * any pertinent fixup.
+ */
if (!q.rt_waiter) {
- /*
- * Got the lock. We might not be the anticipated owner if we
- * did a lock-steal - fix up the PI-state in that case.
- */
if (q.pi_state && (q.pi_state->owner != current)) {
spin_lock(q.lock_ptr);
- ret = fixup_pi_state_owner(uaddr2, &q, current);
+ ret = fixup_owner(uaddr2, &q, true);
/*
* Drop the reference to the pi state which
* the requeue_pi() code acquired for us.
next prev parent reply other threads:[~2021-03-11 18:25 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-26 17:50 [PATCH 1/4] kernel/futex: Kill rt_mutex_next_owner() Davidlohr Bueso
2021-02-26 17:50 ` [PATCH 2/4] kernel/futex: Make futex_wait_requeue_pi() only call fixup_owner() Davidlohr Bueso
2021-03-11 18:24 ` tip-bot2 for Davidlohr Bueso [this message]
2021-02-26 17:50 ` [PATCH 3/4] kernel/futex: Move hb unlock out of unqueue_me_pi() Davidlohr Bueso
2021-03-11 18:24 ` [tip: locking/core] " tip-bot2 for Davidlohr Bueso
2021-02-26 17:50 ` [PATCH 4/4] kernel/futex: Explicitly document pi_lock for pi_state owner fixup Davidlohr Bueso
2021-03-11 18:24 ` [tip: locking/core] " tip-bot2 for Davidlohr Bueso
2021-03-01 15:19 ` [PATCH 1/4] kernel/futex: Kill rt_mutex_next_owner() Peter Zijlstra
2021-03-11 18:24 ` [tip: locking/core] " tip-bot2 for Davidlohr Bueso
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=161548709514.398.3019777443206037709.tip-bot2@tip-bot2 \
--to=tip-bot2@linutronix.de \
--cc=dbueso@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).