From: Qais Yousef <qyousef@layalina.io>
To: Kayra Cizmeci <kayracizmeci@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Vincent Guittot <vincent.guittot@linaro.org>,
Christian Loehle <christian.loehle@arm.com>,
Dietmar Eggemann <dietmar.eggemann@arm.com>,
Steven Rostedt <rostedt@goodmis.org>,
John Stultz <jstultz@google.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH RFC v5 3/4] Revert "sched/rt: Substract number of tasks of throttled queues from rq->nr_running"
Date: Thu, 5 Nov 2026 01:31:37 +0000 [thread overview]
Message-ID: <8401ef7a-de1a-4cb2-a3eb-be02a8436360@layalina.io> (raw)
In-Reply-To: <auoRQiZbirZCFF1x@scheduler.schedules>
On 11/3/26 18:51, Kayra Cizmeci wrote:
> So, as I was saying above I gave this a run. Did some tests:
>
> In my base a RT task can only get a CPU's %95.5, with the series %99.9.
> Even when rt_throttled is 1, task doesn't stop running. I opened
> CONFIG_RT_GROUP_SCHED and set cpu.rt_runtime_us to 950000. cgroup v1.
>
>
> And AFAICT from the code and my tests, nr_running is handled
> differently/wrong with this patch.
>
> When there is a RT group while throttling is enabled, with 2 tasks when
> the group throttles nr_running should be 0. Since, there is nothing to
> run. (If the group is alone in the rq tho :>) But with the patch series,
> it stays 2. I think it's because dec_rt_tasks() does not call
> sub_nr_running() in the group_rt_rq() case of se.
>
>
> Or am I missing something :-)?
This is an RFC as I was looking for potential historical context why it had to
be done this way. I did call out in the cover letter that I am not sure about
the implementation of inc/dec_rt_tasks() and was looking for advise too.
I might have just missed that we have rt_task_is_entity(), does things get
better with the below? Otherwise I'll just need to find the time to figure out
the code and test it properly. Thanks!
--->8---
diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c
index 96d37a1ccc2a8..520273086134d 100644
--- a/kernel/sched/rt.c
+++ b/kernel/sched/rt.c
@@ -1132,7 +1132,7 @@ void inc_rt_tasks(struct sched_rt_entity *rt_se, struct
rt_rq *rt_rq)
inc_rt_prio(rt_rq, prio);
inc_rt_group(rt_se, rt_rq);
- if (!group_rt_rq(rt_se)) {
+ if (rt_entity_is_task(rt_se)) {
struct rq *rq = rq_of_rt_rq(rt_rq);
add_nr_running(rq, 1);
@@ -1151,7 +1151,7 @@ void dec_rt_tasks(struct sched_rt_entity *rt_se, struct
rt_rq *rt_rq)
dec_rt_prio(rt_rq, rt_se_prio(rt_se));
dec_rt_group(rt_se, rt_rq);
- if (!group_rt_rq(rt_se)) {
+ if (rt_entity_is_task(rt_se)) {
struct rq *rq = rq_of_rt_rq(rt_rq);
sub_nr_running(rq, 1);
next prev parent reply other threads:[~2026-11-05 1:31 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-03 0:59 [PATCH v5 0/4] Fix uclamp race against non atomic static key enable Qais Yousef
2026-11-03 0:59 ` [PATCH v5 1/4] sched/uclamp: Fix race condition leading to imbalanced uclamp_rq Qais Yousef
2026-11-03 0:59 ` [PATCH v5 2/4] sched/uclamp: Use wrappers instead of open coding UCLAMP_FLAG_IDLE Qais Yousef
2026-11-03 0:59 ` [PATCH RFC v5 3/4] Revert "sched/rt: Substract number of tasks of throttled queues from rq->nr_running" Qais Yousef
2026-11-03 18:51 ` Kayra Cizmeci
2026-11-05 1:31 ` Qais Yousef [this message]
2026-11-03 0:59 ` [PATCH v5 4/4] sched/uclamp: Move uclamp_rq_{inc, dec}() from core.c Qais Yousef
2026-11-03 1:35 ` Qais Yousef
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=8401ef7a-de1a-4cb2-a3eb-be02a8436360@layalina.io \
--to=qyousef@layalina.io \
--cc=christian.loehle@arm.com \
--cc=dietmar.eggemann@arm.com \
--cc=jstultz@google.com \
--cc=kayracizmeci@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=vincent.guittot@linaro.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
all inboxes | Powered by JetHome®