From: Chengming Zhou <zhouchengming@bytedance.com>
To: Vincent Guittot <vincent.guittot@linaro.org>
Cc: mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com,
dietmar.eggemann@arm.com, rostedt@goodmis.org,
bsegall@google.com, mgorman@suse.de, bristot@redhat.com,
vschneid@redhat.com, odin@uged.al, linux-kernel@vger.kernel.org,
duanxiongchun@bytedance.com, songmuchun@bytedance.com
Subject: Re: [External] Re: [PATCH v3 2/2] sched/fair: optimize and simplify rq leaf_cfs_rq_list
Date: Tue, 31 May 2022 21:55:23 +0800 [thread overview]
Message-ID: <270c2315-7ba5-4bbb-ee5c-38cc8a57e628@bytedance.com> (raw)
In-Reply-To: <CAKfTPtADKqVSvUFmLRPCU_XGVvf3wme0EnnvPf1Q39HEs=VqRw@mail.gmail.com>
Hi,
On 2022/5/30 15:52, Vincent Guittot wrote:
> On Thu, 26 May 2022 at 12:40, Chengming Zhou
> <zhouchengming@bytedance.com> wrote:
>>
[...]
>> @@ -11257,9 +11218,10 @@ static inline bool vruntime_normalized(struct task_struct *p)
>> */
>> static void propagate_entity_cfs_rq(struct sched_entity *se)
>> {
>> - struct cfs_rq *cfs_rq;
>> + struct cfs_rq *cfs_rq = cfs_rq_of(se);
>>
>> - list_add_leaf_cfs_rq(cfs_rq_of(se));
>> + if (!throttled_hierarchy(cfs_rq))
>> + list_add_leaf_cfs_rq(cfs_rq);
>>
>> /* Start to propagate at parent */
>> se = se->parent;
>> @@ -11268,7 +11230,8 @@ static void propagate_entity_cfs_rq(struct sched_entity *se)
>> cfs_rq = cfs_rq_of(se);
>>
>
> you can break if the cfs is throttled because it's sched_entity has
> been dequeued. In this case we check if the cfs is throttled not if
> the hierarchy is throttled
>
> + if (cfs_rq_throttled(cfs_rq))
> + break;
>
This propagate part still make me confused. :-)
I wonder if you think we should change like this:
static void propagate_entity_cfs_rq(struct sched_entity *se)
{
struct cfs_rq *cfs_rq = cfs_rq_of(se);
if (cfs_rq_throttled(cfs_rq)) --> break if cfs is throttled
return;
if (!throttled_hierarchy(cfs_rq))
list_add_leaf_cfs_rq(cfs_rq);
/* Start to propagate at parent */
se = se->parent;
for_each_sched_entity(se) {
cfs_rq = cfs_rq_of(se);
if (cfs_rq_throttled(cfs_rq)) --> break if cfs is throttled
break;
update_load_avg(cfs_rq, se, UPDATE_TG); --> throttled cfs_rq->prop not updated
if (!throttled_hierarchy(cfs_rq))
list_add_leaf_cfs_rq(cfs_rq);
}
}
If I understand right, we should update_load_avg() until cfs_rq_throttled(),
including that throttled cfs_rq? So we can go on propagating when unthrottle.
Maybe like this?
static void propagate_entity_cfs_rq(struct sched_entity *se)
{
struct cfs_rq *cfs_rq = cfs_rq_of(se);
if (cfs_rq_throttled(cfs_rq)) --> break if cfs is throttled
return;
if (!throttled_hierarchy(cfs_rq))
list_add_leaf_cfs_rq(cfs_rq);
/* Start to propagate at parent */
se = se->parent;
for_each_sched_entity(se) {
cfs_rq = cfs_rq_of(se);
update_load_avg(cfs_rq, se, UPDATE_TG); --> update throttled cfs_rq->prop
if (cfs_rq_throttled(cfs_rq)) --> break if cfs is throttled
break;
if (!throttled_hierarchy(cfs_rq))
list_add_leaf_cfs_rq(cfs_rq);
}
}
Thanks!
>> update_load_avg(cfs_rq, se, UPDATE_TG);
>> - list_add_leaf_cfs_rq(cfs_rq);
>> + if (!throttled_hierarchy(cfs_rq))
>> + list_add_leaf_cfs_rq(cfs_rq);
>> }
>> }
>> #else
>> --
>> 2.36.1
>>
next prev parent reply other threads:[~2022-05-31 13:55 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-26 10:39 [PATCH v3 0/2] sched/fair: optimize and simplify rq Chengming Zhou
2022-05-26 10:39 ` [PATCH v3 1/2] sched/fair: fix propagate during synchronous attach/detach Chengming Zhou
2022-05-30 7:31 ` Vincent Guittot
2022-05-26 10:39 ` [PATCH v3 2/2] sched/fair: optimize and simplify rq leaf_cfs_rq_list Chengming Zhou
2022-05-30 7:52 ` Vincent Guittot
2022-05-31 13:55 ` Chengming Zhou [this message]
2022-05-31 16:32 ` [External] " Vincent Guittot
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=270c2315-7ba5-4bbb-ee5c-38cc8a57e628@bytedance.com \
--to=zhouchengming@bytedance.com \
--cc=bristot@redhat.com \
--cc=bsegall@google.com \
--cc=dietmar.eggemann@arm.com \
--cc=duanxiongchun@bytedance.com \
--cc=juri.lelli@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=odin@uged.al \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=songmuchun@bytedance.com \
--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
all inboxes | Powered by JetHome®