lkml.org 
[lkml]   [2021]   [May]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[tip: locking/core] futex: Deduplicate cond_resched() invocation in futex_wake_op()
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;
}

\
 
 \ /
  Last update: 2021-05-25 17:37    [W:0.042 / U:0.748 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site