From: Dietmar Eggemann <dietmar.eggemann@arm.com>
To: "benbjiang(蒋彪)" <benbjiang@tencent.com>
Cc: Jiang Biao <benbjiang@gmail.com>,
"mingo@redhat.com" <mingo@redhat.com>,
Peter Zijlstra <peterz@infradead.org>,
"juri.lelli@redhat.com" <juri.lelli@redhat.com>,
"vincent.guittot@linaro.org" <vincent.guittot@linaro.org>,
"rostedt@goodmis.org" <rostedt@goodmis.org>,
"bsegall@google.com" <bsegall@google.com>,
"mgorman@suse.de" <mgorman@suse.de>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH RFC] sched/fair: simplfy the work when reweighting entity
Date: Thu, 6 Aug 2020 16:48:50 +0200 [thread overview]
Message-ID: <c97da668-09ec-4368-cfd4-13cbbbd6a4a5@arm.com> (raw)
In-Reply-To: <8FA38F12-3CB4-46A9-B654-92DC384D3103@tencent.com>
On 06/08/2020 04:42, benbjiang(蒋彪) wrote:
>
>
>> On Aug 6, 2020, at 12:21 AM, Dietmar Eggemann <dietmar.eggemann@arm.com> wrote:
>>
>> On 04/08/2020 09:12, Jiang Biao wrote:
>>> If a se is on_rq when reweighting entity, all we need should be
>>> updating the load of cfs_rq, other dequeue/enqueue works could be
>>> redundant, such as,
>>> * account_numa_dequeue/account_numa_enqueue
>>> * list_del/list_add from/into cfs_tasks
>>> * nr_running--/nr_running++
>>
>> I think this could make sense. Have you spotted a code path where this
>> gives you a change?
>>
>> I guess only for a task on the rq, so: entity_is_task(se) && se->on_rq
> Yes, you're right. No other code path I spotted except what you list below.
>
>>
>>> Just simplfy the work. Could be helpful for the hot path.
>>
>> IMHO hotpath is update_cfs_group() -> reweight_entity() but this is only
>> called for '!entity_is_task(se)'.
>>
>> See
>>
>> 3290 if (!gcfs_rq)
>> 3291 return;
>>
>> in update_cfs_group().
> Yes, It is.
> But *nr_running--/nr_running++* works are still redundant for
> ‘!entity_is_task(se)' hot path. :)
True.
> Besides, I guess we could simplify the logic and make it cleaner and
> more readable with this patch.
Yes.
> If it could make sense to you, would you mind if I resend the patch
> with the commit log amended?
LGTM so why not?
>> The 'entity_is_task(se)' case is
>>
>> set_load_weight(struct task_struct *p, ...) -> reweight_task(p, ...) ->
>> reweight_entity(..., &p->se, ...)
>>
>> but here !se->on_rq.
> Yes, indeed.
[...]
prev parent reply other threads:[~2020-08-06 17:27 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-04 7:12 Jiang Biao
2020-08-05 16:21 ` Dietmar Eggemann
2020-08-06 2:42 ` benbjiang(蒋彪)
2020-08-06 14:48 ` Dietmar Eggemann [this message]
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=c97da668-09ec-4368-cfd4-13cbbbd6a4a5@arm.com \
--to=dietmar.eggemann@arm.com \
--cc=benbjiang@gmail.com \
--cc=benbjiang@tencent.com \
--cc=bsegall@google.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=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®