From: K Prateek Nayak <kprateek.nayak@amd.com>
To: Madadi Vineeth Reddy <vineethr@linux.ibm.com>
Cc: <bsegall@google.com>, <dietmar.eggemann@arm.com>,
<gautham.shenoy@amd.com>, <juri.lelli@redhat.com>,
<linux-kernel@vger.kernel.org>, <mgorman@suse.de>,
<mingo@redhat.com>, <peterz@infradead.org>, <rostedt@goodmis.org>,
<swapnil.sapkal@amd.com>, <vincent.guittot@linaro.org>,
<vschneid@redhat.com>
Subject: Re: [PATCH] sched/fair: Fix inaccurate h_nr_runnable accounting with delayed dequeue
Date: Mon, 20 Jan 2025 14:42:16 +0530 [thread overview]
Message-ID: <f55e536e-80e2-40f2-bf90-9c148ef63a4d@amd.com> (raw)
In-Reply-To: <20250120050639.48966-1-vineethr@linux.ibm.com>
Hello Madadi Vineeth Reddy,
Thank you for the review and test.
On 1/20/2025 10:36 AM, Madadi Vineeth Reddy wrote:
> Hi Prateek,
>
>> A SCHED_WARN_ON() to inspect h_nr_runnable post its update in
>> dequeue_entities() like below:
>>
>> cfs_rq->h_nr_runnable -= h_nr_runnable;
>> SCHED_WARN_ON(((int) cfs_rq->h_nr_runnable) < 0);
>>
>> is consistently tripped when running wakeup intensive workloads like
>> hackbench in a cgroup.
>
> I observed that the WARN_ON is triggered during the boot process without
> the patch, and the patch resolves the issue.
>
> However, I was unable to trigger the WARN_ON by running hackbench in a
> cgroup without the patch. Could you please share the specific test
> scenario or configuration you used to reproduce it?
Can you try converting the SCHED_WARN_ON() to a WARN_ON() and try again.
I can consistently hit it to a point that it floods my console. With
autogroup enabled on Ubuntu, I believe it is trivial to hit this issue.
Following is the exact diff I'm using on top of tip:sched/core that
floods my console:
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 98ac49ce78ea..7bc2c57601b6 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -7160,6 +7160,7 @@ static int dequeue_entities(struct rq *rq, struct sched_entity *se, int flags)
cfs_rq->h_nr_runnable -= h_nr_runnable;
cfs_rq->h_nr_queued -= h_nr_queued;
+ WARN_ON(((int) cfs_rq->h_nr_runnable) < 0);
cfs_rq->h_nr_idle -= h_nr_idle;
if (cfs_rq_is_idle(cfs_rq))
@@ -7199,6 +7200,7 @@ static int dequeue_entities(struct rq *rq, struct sched_entity *se, int flags)
cfs_rq->h_nr_runnable -= h_nr_runnable;
cfs_rq->h_nr_queued -= h_nr_queued;
+ WARN_ON(((int) cfs_rq->h_nr_runnable) < 0);
cfs_rq->h_nr_idle -= h_nr_idle;
if (cfs_rq_is_idle(cfs_rq))
--
I tested this on a 32 vCPU VM and I get similar floods.
>
> For the boot process scenario:
> Tested-by: Madadi Vineeth Reddy <vineethr@linux.ibm.com>
Thanks a ton for testing!
>
> Thanks,
> Madadi Vineeth Reddy
--
Thanks and Regards,
Prateek
next prev parent reply other threads:[~2025-01-20 9:12 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-17 10:58 [PATCH] sched/fair: Fix inaccurate h_nr_runnable accounting with delayed dequeue K Prateek Nayak
2025-01-17 13:25 ` Vincent Guittot
2025-01-17 15:59 ` K Prateek Nayak
2025-01-18 8:30 ` Vincent Guittot
2025-01-21 8:09 ` K Prateek Nayak
2025-01-21 9:53 ` Vincent Guittot
2025-01-20 5:06 ` Madadi Vineeth Reddy
2025-01-20 8:44 ` Madadi Vineeth Reddy
2025-01-20 9:14 ` K Prateek Nayak
2025-01-20 9:12 ` K Prateek Nayak [this message]
2025-01-21 12:21 ` [tip: sched/urgent] " tip-bot2 for 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=f55e536e-80e2-40f2-bf90-9c148ef63a4d@amd.com \
--to=kprateek.nayak@amd.com \
--cc=bsegall@google.com \
--cc=dietmar.eggemann@arm.com \
--cc=gautham.shenoy@amd.com \
--cc=juri.lelli@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=swapnil.sapkal@amd.com \
--cc=vincent.guittot@linaro.org \
--cc=vineethr@linux.ibm.com \
--cc=vschneid@redhat.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