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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <172803696357.1442.2246637734523151243.tip-bot2@tip-bot2>
Date: Fri, 04 Oct 2024 10:16:03 -0000
From: "tip-bot2 for Mike Galbraith" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Venkat Rao Bagalkote <venkat88@...ux.vnet.ibm.com>,
 Mike Galbraith <efault@....de>,
 "Peter Zijlstra (Intel)" <peterz@...radead.org>, x86@...nel.org,
 linux-kernel@...r.kernel.org
Subject: [tip: sched/urgent] sched: Fix sched_delayed vs cfs_bandwidth

The following commit has been merged into the sched/urgent branch of tip:

Commit-ID:     9b5ce1a37e904fac32d560668134965f4e937f6c
Gitweb:        https://git.kernel.org/tip/9b5ce1a37e904fac32d560668134965f4e937f6c
Author:        Mike Galbraith <efault@....de>
AuthorDate:    Tue, 01 Oct 2024 03:34:01 +02:00
Committer:     Peter Zijlstra <peterz@...radead.org>
CommitterDate: Wed, 02 Oct 2024 11:27:54 +02:00

sched: Fix sched_delayed vs cfs_bandwidth

Meeting an unfinished DELAY_DEQUEUE treated entity in unthrottle_cfs_rq()
leads to a couple terminal scenarios.  Finish it first, so ENQUEUE_WAKEUP
can proceed as it would have sans DELAY_DEQUEUE treatment.

Fixes: 152e11f6df29 ("sched/fair: Implement delayed dequeue")
Reported-by: Venkat Rao Bagalkote <venkat88@...ux.vnet.ibm.com>
Signed-off-by: Mike Galbraith <efault@....de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
Tested-by: Venkat Rao Bagalkote <venkat88@...ux.vnet.ibm.com>
Link: https://lore.kernel.org/r/7515d2e64c989b9e3b828a9e21bcd959b99df06a.camel@gmx.de
---
 kernel/sched/fair.c |  9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 225b31a..b63a7ac 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -6058,10 +6058,13 @@ void unthrottle_cfs_rq(struct cfs_rq *cfs_rq)
 	for_each_sched_entity(se) {
 		struct cfs_rq *qcfs_rq = cfs_rq_of(se);
 
-		if (se->on_rq) {
-			SCHED_WARN_ON(se->sched_delayed);
+		/* Handle any unfinished DELAY_DEQUEUE business first. */
+		if (se->sched_delayed) {
+			int flags = DEQUEUE_SLEEP | DEQUEUE_DELAYED;
+
+			dequeue_entity(qcfs_rq, se, flags);
+		} else if (se->on_rq)
 			break;
-		}
 		enqueue_entity(qcfs_rq, se, ENQUEUE_WAKEUP);
 
 		if (cfs_rq_is_idle(group_cfs_rq(se)))

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ