mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mike Galbraith <efault@gmx.de>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>,
	Venkat Rao Bagalkote <venkat88@linux.vnet.ibm.com>
Subject: [patch] sched: Fix sched_delayed vs cfs_bandwidth
Date: Tue, 01 Oct 2024 03:34:01 +0200	[thread overview]
Message-ID: <7515d2e64c989b9e3b828a9e21bcd959b99df06a.camel@gmx.de> (raw)
In-Reply-To: <2fb24ab402d9de45e3cf16e6ba0ad23a7843e5c1.camel@gmx.de>


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@linux.vnet.ibm.com>
Tested-by: Venkat Rao Bagalkote <venkat88@linux.vnet.ibm.com>
Signed-off-by: Mike Galbraith <efault@gmx.de>
---
 kernel/sched/fair.c |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -6058,10 +6058,13 @@ void unthrottle_cfs_rq(struct cfs_rq *cf
 	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)))


  parent reply	other threads:[~2024-10-01  1:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-16  6:30 [PowerPC][Linux-next][6.11.0-rc4-next-20240820] OOPs while running LTP FS Stress Venkat Rao Bagalkote
2024-09-16 11:30 ` Peter Zijlstra
2024-09-16 14:40   ` Venkat Rao Bagalkote
2024-09-19  6:09 ` [patch] " Mike Galbraith
2024-09-19 14:39   ` Venkat Rao Bagalkote
2024-09-20  2:15     ` Mike Galbraith
2024-10-01  1:34   ` Mike Galbraith [this message]
2024-10-04 10:16     ` [tip: sched/urgent] sched: Fix sched_delayed vs cfs_bandwidth tip-bot2 for Mike Galbraith

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=7515d2e64c989b9e3b828a9e21bcd959b99df06a.camel@gmx.de \
    --to=efault@gmx.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=venkat88@linux.vnet.ibm.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®