public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Parag W <parag.lkml@gmail.com>
To: hannes@cmpxchg.org
Cc: anna-maria@linutronix.de, frederic@kernel.org,
	linux-kernel@vger.kernel.org, peterz@infradead.org,
	pmenzel@molgen.mpg.de, regressions@lists.linux.dev,
	surenb@google.com, tglx@linutronix.de
Subject: Re: Error: psi: inconsistent task state! task=1:swapper/0 cpu=0 psi_flags=4 clear=0 set=4
Date: Mon, 23 Sep 2024 08:03:39 -0400	[thread overview]
Message-ID: <20240923120339.11809-1-parag.lkml@gmail.com> (raw)
In-Reply-To: <20240922102047.GA437832@cmpxchg.org>

FWIW, moving psi_enqueue to be after ->enqueue_task() in sched/core.c made no difference - I still get the inconsistent task state error. psi_dequeue() is already before ->dequeue_task() in line with uclamp.


diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index b6cc1cf499d6..748143d2c218 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -2012,16 +2012,16 @@ void enqueue_task(struct rq *rq, struct task_struct *p, int flags)
 	if (!(flags & ENQUEUE_NOCLOCK))
 		update_rq_clock(rq);
 
-	if (!(flags & ENQUEUE_RESTORE)) {
-		sched_info_enqueue(rq, p);
-		psi_enqueue(p, (flags & ENQUEUE_WAKEUP) && !(flags & ENQUEUE_MIGRATED));
-	}
 
 	p->sched_class->enqueue_task(rq, p, flags);
 	/*
 	 * Must be after ->enqueue_task() because ENQUEUE_DELAYED can clear
 	 * ->sched_delayed.
 	 */
+	if (!(flags & ENQUEUE_RESTORE)) {
+		sched_info_enqueue(rq, p);
+		psi_enqueue(p, (flags & ENQUEUE_WAKEUP) && !(flags & ENQUEUE_MIGRATED));
+	}
 	uclamp_rq_inc(rq, p);
 
 	if (sched_core_enabled(rq))

  reply	other threads:[~2024-09-23 12:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-21 22:50 Error: psi: inconsistent task state! task=1:swapper/0 cpu=0 psi_flags=4 clear=0 set=4 Paul Menzel
2024-09-22  6:53 ` Paul Menzel
2024-09-22 10:20   ` Johannes Weiner
2024-09-23 12:03     ` Parag W [this message]
2024-09-23 15:46       ` Johannes Weiner
2024-10-01  1:21         ` Johannes Weiner

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=20240923120339.11809-1-parag.lkml@gmail.com \
    --to=parag.lkml@gmail.com \
    --cc=anna-maria@linutronix.de \
    --cc=frederic@kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=pmenzel@molgen.mpg.de \
    --cc=regressions@lists.linux.dev \
    --cc=surenb@google.com \
    --cc=tglx@linutronix.de \
    /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