From: Johannes Weiner <hannes@cmpxchg.org>
To: K Prateek Nayak <kprateek.nayak@amd.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
Klaus Kudielka <klaus.kudielka@gmail.com>,
Chris Bainbridge <chris.bainbridge@gmail.com>,
linux-kernel@vger.kernel.org, bsegall@google.com,
dietmar.eggemann@arm.com, efault@gmx.de, juri.lelli@redhat.com,
mgorman@suse.de, mingo@redhat.com, rostedt@goodmis.org,
tglx@linutronix.de, vincent.guittot@linaro.org,
vschneid@redhat.com, wuyun.abel@bytedance.com,
youssefesmat@chromium.org, spasswolf@web.de,
regressions@lists.linux.dev,
"Linux regression tracking (Thorsten Leemhuis)"
<regressions@leemhuis.info>,
"Gautham R. Shenoy" <gautham.shenoy@amd.com>
Subject: Re: [REGRESSION] Re: [PATCH 17/24] sched/fair: Implement delayed dequeue
Date: Wed, 9 Oct 2024 14:07:19 -0400 [thread overview]
Message-ID: <20241009180719.GD6937@cmpxchg.org> (raw)
In-Reply-To: <f82def74-a64a-4a05-c8d4-4eeb3e03d0c0@amd.com>
On Tue, Oct 08, 2024 at 09:54:52PM +0530, K Prateek Nayak wrote:
> From 2e15180e18b51e9a2bc0d7050e915a70d2673a06 Mon Sep 17 00:00:00 2001
> From: K Prateek Nayak <kprateek.nayak@amd.com>
> Date: Fri, 4 Oct 2024 15:24:35 +0000
> Subject: [RFC PATCH] sched/psi: Fixup PSI accounting with DELAY_DEQUEUE
>
> After the merge of DELAY_DEQUEUE, "psi: inconsistent task state: warning
> were seen early into the boot. The crux of the matter is the fact that
> when a task is delayed, and the delayed task is then migrated, the
> wakeup context may not have any idea that the task was moved from its
> previous runqueue. This is the same reason psi_enqueue() considers
> only ...
>
> (flags & ENQUEUE_WAKEUP) && !(flags & ENQUEUE_MIGRATED)
>
> ... as a wakeup. In case of a wakeup with migration, PSI forgoes
> clearing the TSK_IOWAIT flag which seems to be the issue I encountered
> in my splat previously.
>
> With that said, the below diff, based on Peter's original approach
> currently seems to work for me in the sense that I have not seen the
> inconsistent state warning for a while now with my stress test.
>
> Two key points of the approach are:
>
> o It uses "p->migration_flags" to indicate a delayed entity has
> migrated to another runqueue and convey the same during psi_enqueue().
>
> o It adds ENQUEUE_WAKEUP flag alongside ENQUEUE_DELAYED for
> enqueue_task() in ttwu_runnable() since psi_enqueue() needs to know of
> a wakeup without migration to clear the TSK_IOWAIT flag it would have
> set during psi_task_switch() for blocking task and going down the
> stack for enqueue_task_fair(), there seem to be no other observer of
> the ENQUEUE_WAKEUP flag other than psi_enqueue() in the requeue path.
>
> Suggested-by: Peter Zijlstra <peterz@infradead.org>
> Signed-off-by: K Prateek Nayak <kprateek.nayak@amd.com>
Tested-by: Johannes Weiner <hannes@cmpxchg.org>
It fixes the warning and bogus pressure values after stressing it for
an hour or so with tons of cpu contention and cgroup movements.
next prev parent reply other threads:[~2024-10-09 18:07 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-30 12:34 Bert Karwatzki
2024-09-22 15:45 ` [REGRESSION] " Chris Bainbridge
2024-09-22 16:01 ` Linux regression tracking (Thorsten Leemhuis)
2024-10-03 5:31 ` Klaus Kudielka
2024-10-04 11:10 ` K Prateek Nayak
2024-10-04 12:35 ` Peter Zijlstra
2024-10-04 13:57 ` Johannes Weiner
2024-10-04 16:43 ` K Prateek Nayak
2024-10-08 15:38 ` K Prateek Nayak
2024-10-08 16:24 ` K Prateek Nayak
2024-10-09 18:07 ` Johannes Weiner [this message]
2024-10-10 3:26 ` K Prateek Nayak
2024-10-04 17:01 ` 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=20241009180719.GD6937@cmpxchg.org \
--to=hannes@cmpxchg.org \
--cc=bsegall@google.com \
--cc=chris.bainbridge@gmail.com \
--cc=dietmar.eggemann@arm.com \
--cc=efault@gmx.de \
--cc=gautham.shenoy@amd.com \
--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=peterz@infradead.org \
--cc=regressions@leemhuis.info \
--cc=regressions@lists.linux.dev \
--cc=rostedt@goodmis.org \
--cc=spasswolf@web.de \
--cc=tglx@linutronix.de \
--cc=vincent.guittot@linaro.org \
--cc=vschneid@redhat.com \
--cc=wuyun.abel@bytedance.com \
--cc=youssefesmat@chromium.org \
/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
Powered by JetHome