From: Yajun Deng <yajun.deng@linux.dev>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@kernel.org>,
mingo@redhat.com, juri.lelli@redhat.com,
vincent.guittot@linaro.org, dietmar.eggemann@arm.com,
rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de,
bristot@redhat.com, vschneid@redhat.com,
linux-kernel@vger.kernel.org,
kernel test robot <oliver.sang@intel.com>
Subject: Re: [PATCH v4] sched/rt: move back to RT_GROUP_SCHED and rename it child
Date: Wed, 4 Oct 2023 23:35:26 +0800 [thread overview]
Message-ID: <a1fe7d7d-3521-648e-baeb-5cf8e2a8ae3a@linux.dev> (raw)
In-Reply-To: <20231003163719.GG1539@noisy.programming.kicks-ass.net>
On 2023/10/4 00:37, Peter Zijlstra wrote:
> On Tue, Oct 03, 2023 at 10:55:50PM +0800, Yajun Deng wrote:
>
>> @Peter, I think I split up this patch into 2 separate patches:
>>
>> sched/rt: Introduce for_each_sched_rt_entity_back() & use it
> Why ?? Having that macro makes no sense what so ever. You can't use it,
> unless you set up the back pointers first. It is not a self contained
> piece of functionality.
The 2nd patch rely on this patch. It will be used in dequeue_rt_stack.
We need to add a macro first,
because the 'back' will be not exist after the 2nd patch when disable
CONFIG_RT_GROUP_SCHED.
diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c
index 88fc98601413..0b6b4a715d6e 100644
--- a/kernel/sched/rt.c
+++ b/kernel/sched/rt.c
@@ -520,6 +520,9 @@ static inline struct task_group
*next_task_group(struct task_group *tg)
#define for_each_sched_rt_entity(rt_se) \
for (; rt_se; rt_se = rt_se->parent)
+#define for_each_sched_rt_back(rt_se) \
+ for (; rt_se; rt_se = rt_se->back)
+
static inline struct rt_rq *group_rt_rq(struct sched_rt_entity *rt_se)
{
return rt_se->my_q;
@@ -625,6 +628,9 @@ typedef struct rt_rq *rt_rq_iter_t;
#define for_each_sched_rt_entity(rt_se) \
for (; rt_se; rt_se = NULL)
+#define for_each_sched_rt_entity_back(rt_se) \
+ for_each_sched_rt_entity(rt_se)
+
static inline struct rt_rq *group_rt_rq(struct sched_rt_entity *rt_se)
{
return NULL;
@@ -1445,7 +1451,8 @@ static void dequeue_rt_stack(struct
sched_rt_entity *rt_se, unsigned int flags)
rt_nr_running = rt_rq_of_se(back)->rt_nr_running;
- for (rt_se = back; rt_se; rt_se = rt_se->back) {
+ rt_se = back;
+ for_each_sched_rt_entity_back(rt_se) {
if (on_rt_rq(rt_se))
__dequeue_rt_entity(rt_se, flags);
}
>
>> sched/rt: Move sched_rt_entity::back to under the
>> CONFIG_RT_GROUP_SCHED block
> This one sure.
next prev parent reply other threads:[~2023-10-04 15:35 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-03 5:03 [PATCH v4] sched/rt: move back to RT_GROUP_SCHED and rename it child Yajun Deng
2023-10-03 9:51 ` Ingo Molnar
2023-10-03 14:55 ` Yajun Deng
2023-10-03 16:37 ` Peter Zijlstra
2023-10-04 15:35 ` Yajun Deng [this message]
2023-10-03 10:36 ` Peter Zijlstra
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=a1fe7d7d-3521-648e-baeb-5cf8e2a8ae3a@linux.dev \
--to=yajun.deng@linux.dev \
--cc=bristot@redhat.com \
--cc=bsegall@google.com \
--cc=dietmar.eggemann@arm.com \
--cc=juri.lelli@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=mingo@kernel.org \
--cc=mingo@redhat.com \
--cc=oliver.sang@intel.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=vincent.guittot@linaro.org \
--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