linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "tip-bot2 for Pavel Begunkov" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Pavel Begunkov <asml.silence@gmail.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Davidlohr Bueso <dbueso@suse.de>,
	x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: locking/core] futex: Deduplicate cond_resched() invocation in futex_wake_op()
Date: Tue, 25 May 2021 15:35:56 -0000	[thread overview]
Message-ID: <162195695671.29796.5893139946857562110.tip-bot2@tip-bot2> (raw)
In-Reply-To: =?utf-8?q?=3C9b2588c1fd33c91fb01c4e348a3b647ab2c8baab=2E16212?= =?utf-8?q?58128=2Egit=2Easml=2Esilence=40gmail=2Ecom=3E?=

The following commit has been merged into the locking/core branch of tip:

Commit-ID:     a82adc7650044b5555d65078bda07866efa4a73d
Gitweb:        https://git.kernel.org/tip/a82adc7650044b5555d65078bda07866efa4a73d
Author:        Pavel Begunkov <asml.silence@gmail.com>
AuthorDate:    Mon, 17 May 2021 14:30:12 +01:00
Committer:     Thomas Gleixner <tglx@linutronix.de>
CommitterDate: Tue, 25 May 2021 17:30:15 +02:00

futex: Deduplicate cond_resched() invocation in futex_wake_op()

After pagefaulting in futex_wake_op() both branches do cond_resched()
before retry. Deduplicate it as compilers cannot figure it out themself.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Davidlohr Bueso <dbueso@suse.de>
Link: https://lore.kernel.org/r/9b2588c1fd33c91fb01c4e348a3b647ab2c8baab.1621258128.git.asml.silence@gmail.com

---
 kernel/futex.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/kernel/futex.c b/kernel/futex.c
index 2f386f0..08008c2 100644
--- a/kernel/futex.c
+++ b/kernel/futex.c
@@ -1728,12 +1728,9 @@ retry_private:
 				return ret;
 		}
 
-		if (!(flags & FLAGS_SHARED)) {
-			cond_resched();
-			goto retry_private;
-		}
-
 		cond_resched();
+		if (!(flags & FLAGS_SHARED))
+			goto retry_private;
 		goto retry;
 	}
 

                 reply	other threads:[~2021-05-25 15:36 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=162195695671.29796.5893139946857562110.tip-bot2@tip-bot2 \
    --to=tip-bot2@linutronix.de \
    --cc=asml.silence@gmail.com \
    --cc=dbueso@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.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).