lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <162195695671.29796.5893139946857562110.tip-bot2@tip-bot2>
Date:   Tue, 25 May 2021 15:35:56 -0000
From:   "tip-bot2 for Pavel Begunkov" <tip-bot2@...utronix.de>
To:     linux-tip-commits@...r.kernel.org
Cc:     Pavel Begunkov <asml.silence@...il.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        Davidlohr Bueso <dbueso@...e.de>, x86@...nel.org,
        linux-kernel@...r.kernel.org
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@...il.com>
AuthorDate:    Mon, 17 May 2021 14:30:12 +01:00
Committer:     Thomas Gleixner <tglx@...utronix.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@...il.com>
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
Reviewed-by: Davidlohr Bueso <dbueso@...e.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;
 	}
 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ