[tip: locking/core] futex: Deduplicate cond_resched() invocation in futex_wake_op()
From: tip-bot2 for Pavel Begunkov
Date: Tue May 25 2021 - 11:36:02 EST
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@xxxxxxxxx>
AuthorDate: Mon, 17 May 2021 14:30:12 +01:00
Committer: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
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@xxxxxxxxx>
Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Reviewed-by: Davidlohr Bueso <dbueso@xxxxxxx>
Link: https://lore.kernel.org/r/9b2588c1fd33c91fb01c4e348a3b647ab2c8baab.1621258128.git.asml.silence@xxxxxxxxx
---
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;
}