public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: K Prateek Nayak <kprateek.nayak@amd.com>
Cc: Ingo Molnar <mingo@redhat.com>,
	Juri Lelli <juri.lelli@redhat.com>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Suren Baghdasaryan <surenb@google.com>,
	linux-kernel@vger.kernel.org,
	Dietmar Eggemann <dietmar.eggemann@arm.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Ben Segall <bsegall@google.com>, Mel Gorman <mgorman@suse.de>,
	Valentin Schneider <vschneid@redhat.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Klaus Kudielka <klaus.kudielka@gmail.com>,
	Chris Bainbridge <chris.bainbridge@gmail.com>,
	"Linux regression tracking (Thorsten Leemhuis)"
	<regressions@leemhuis.info>,
	"Gautham R. Shenoy" <gautham.shenoy@amd.com>,
	Youssef Esmat <youssefesmat@google.com>,
	Paul Menzel <pmenzel@molgen.mpg.de>,
	Bert Karwatzki <spasswolf@web.de>,
	regressions@lists.linux.dev
Subject: Re: [PATCH 0/3] sched/core: Fix PSI inconsistent task state splats with DELAY_DEQUEUE
Date: Thu, 10 Oct 2024 12:47:24 +0200	[thread overview]
Message-ID: <20241010104724.GK14587@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <20241010082838.2474-1-kprateek.nayak@amd.com>

On Thu, Oct 10, 2024 at 08:28:35AM +0000, K Prateek Nayak wrote:
> After the introduction of DELAY_DEQUEUE, PSI consistently started
> warning about inconsistent task state early into the boot. This could be
> root-caused to three issues that the three patches respectively solve:
> 
> o PSI signals not being dequeued when the task is blocked, but also
>   delayed since psi_sched_switch() considered "!task_on_rq_queued()" as
>   the task being blocked but a delayed task will remain queued on the
>   runqueue until it is picked again and goes through a full dequeue.
> 
> o enqueue_task() not using the ENQUEUE_WAKEUP alongside ENQUEUE_DELAYED
>   in ttwu_runnable(). Since psi_enqueue() only considers (in terms of
>   enqueue flags):
> 
>     (flags & ENQUEUE_WAKEUP) && !(flags & ENQUEUE_MIGRATED)
> 
>   ... as a wakeup, the lack of ENQUEUE_WAKEUP can misguide psi_enqueue()
>   which only clears TSK_IOWAIT flag on wakeups.
> 
> o When a delayed task is migrated by the load balancer, the requeue or
>   the wakeup context may be aware that the task has migrated between it
>   blocking and it waking up. This is necessary to be communicated to PSI
>   which forgoes clearing TSK_IOWAIT since it expects the psi_.*dequeue()
>   to have cleared it during migration.
> 
> The series correctly communicates the blocked status of a delayed task
> to psi_dequeue(), adds the ENQUEUE_WAKEUP flag during a requeue in
> ttwu_runnable(), re-arranges the psi_enqueue() to be called after a
> "p->sched_class->enqueue_task()", and notify psi_enqueue() of a
> migration in delayed state using "p->migration_flags" to maintain the
> task state consistently.
> 
> This series was previously posted as one large diff at
> https://lore.kernel.org/lkml/f82def74-a64a-4a05-c8d4-4eeb3e03d0c0@amd.com/
> and was tested by Johannes. The tags on the diff have been carried
> to this series.

Thanks!

I've renamed DELAYED_MIGRATED to MF_DELAYED, and made a note to go
rename the MDF_PUSH thing to something consistent.

I've stuck then in queue.git sched/urgent along with a few other fixes
and I will hopefully push the lot into tip soon.

  parent reply	other threads:[~2024-10-10 10:47 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-10  8:28 [PATCH 0/3] sched/core: Fix PSI inconsistent task state splats with DELAY_DEQUEUE K Prateek Nayak
2024-10-10  8:28 ` [PATCH 1/3] sched/core: Dequeue PSI signals for blocked tasks that are delayed K Prateek Nayak
2024-10-10 19:23   ` Johannes Weiner
2024-10-10  8:28 ` [PATCH 2/3] sched/core: Add ENQUEUE_WAKEUP flag alongside ENQUEUE_DELAYED K Prateek Nayak
2024-10-10  8:28 ` [PATCH 3/3] sched/core: Indicate a sched_delayed task was migrated before wakeup K Prateek Nayak
2024-10-10 13:03   ` Johannes Weiner
2024-10-10 13:06     ` Peter Zijlstra
2024-10-10 19:37       ` Johannes Weiner
2024-10-11  3:31         ` K Prateek Nayak
2024-10-11  8:33         ` Peter Zijlstra
2024-10-11 10:08           ` Johannes Weiner
2024-10-11 10:39             ` Peter Zijlstra
2024-10-14 14:43               ` Johannes Weiner
2024-10-15  3:11                 ` K Prateek Nayak
2024-10-28 13:28                 ` [tip: sched/core] sched: psi: pass enqueue/dequeue flags to psi callbacks directly tip-bot2 for Johannes Weiner
2024-10-12 14:15         ` [tip: sched/urgent] Since sched_delayed tasks remain queued even after blocking, the load tip-bot2 for Johannes Weiner
2024-10-14  7:28         ` [tip: sched/urgent] sched/psi: Fix mistaken CPU pressure indication after corrupted task state bug tip-bot2 for Johannes Weiner
2024-10-10 15:59     ` [PATCH 3/3] sched/core: Indicate a sched_delayed task was migrated before wakeup K Prateek Nayak
2024-10-10 10:47 ` Peter Zijlstra [this message]
2024-10-10 10:57   ` [PATCH 0/3] sched/core: Fix PSI inconsistent task state splats with DELAY_DEQUEUE K Prateek Nayak

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=20241010104724.GK14587@noisy.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=bsegall@google.com \
    --cc=chris.bainbridge@gmail.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=gautham.shenoy@amd.com \
    --cc=hannes@cmpxchg.org \
    --cc=juri.lelli@redhat.com \
    --cc=klaus.kudielka@gmail.com \
    --cc=kprateek.nayak@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=pmenzel@molgen.mpg.de \
    --cc=regressions@leemhuis.info \
    --cc=regressions@lists.linux.dev \
    --cc=rostedt@goodmis.org \
    --cc=spasswolf@web.de \
    --cc=surenb@google.com \
    --cc=tglx@linutronix.de \
    --cc=vincent.guittot@linaro.org \
    --cc=vschneid@redhat.com \
    --cc=youssefesmat@google.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