All of lore.kernel.org
 help / color / mirror / Atom feed
From: Davidlohr Bueso <dave@stgolabs.net>
To: Pavel Begunkov <asml.silence@gmail.com>
Cc: linux-kernel@vger.kernel.org,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Darren Hart <dvhart@infradead.org>
Subject: Re: [PATCH for-next] futex: deduplicate resched in futex_wake_op()
Date: Thu, 20 May 2021 11:16:00 -0700	[thread overview]
Message-ID: <20210520181600.oupnaspukteh7dsk@offworld> (raw)
In-Reply-To: <9b2588c1fd33c91fb01c4e348a3b647ab2c8baab.1621258128.git.asml.silence@gmail.com>

On Mon, 17 May 2021, Pavel Begunkov wrote:

>After pagefaulting in futex_wake_op() both branches do cond_resched()
>before retry. Help to deduplicate it as many compilers can't cope with
>it.
>

LGTM:

Reviewed-by: Davidlohr Bueso <dbueso@suse.de>

>Signed-off-by: Pavel Begunkov <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 c98b825da9cf..54ed232b2553 100644
>--- a/kernel/futex.c
>+++ b/kernel/futex.c
>@@ -1728,12 +1728,9 @@ futex_wake_op(u32 __user *uaddr1, unsigned int flags, u32 __user *uaddr2,
> 				return ret;
> 		}
>
>-		if (!(flags & FLAGS_SHARED)) {
>-			cond_resched();
>-			goto retry_private;
>-		}
>-
> 		cond_resched();
>+		if (!(flags & FLAGS_SHARED))
>+			goto retry_private;
> 		goto retry;
> 	}
>
>-- 
>2.31.1
>

      reply	other threads:[~2021-05-20 18:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-17 13:30 [PATCH for-next] futex: deduplicate resched in futex_wake_op() Pavel Begunkov
2021-05-20 18:16 ` 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=20210520181600.oupnaspukteh7dsk@offworld \
    --to=dave@stgolabs.net \
    --cc=asml.silence@gmail.com \
    --cc=dvhart@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.