From: Vincent Guittot <vincent.guittot@linaro.org>
To: Tejun Heo <tj@kernel.org>
Cc: Ingo Molnar <mingo@redhat.com>,
Peter Zijlstra <peterz@infradead.org>,
linux-kernel <linux-kernel@vger.kernel.org>,
Linus Torvalds <torvalds@linux-foundation.org>,
Mike Galbraith <efault@gmx.de>, Paul Turner <pjt@google.com>,
Chris Mason <clm@fb.com>,
kernel-team@fb.com
Subject: Re: [PATCH 3/3] sched/fair: Propagate runnable_load_avg independently from load_avg
Date: Fri, 5 May 2017 18:51:25 +0200 [thread overview]
Message-ID: <CAKfTPtAVOdyCxVMTXwBadtVWyiaLMjSeL8bTuLatZBxgAKJF2Q@mail.gmail.com> (raw)
In-Reply-To: <20170504203010.GD2647@htj.duckdns.org>
On 4 May 2017 at 22:30, Tejun Heo <tj@kernel.org> wrote:
[snip]
> /* Take into account change of load of a child task group */
> static inline void
> update_tg_cfs_load(struct cfs_rq *cfs_rq, struct sched_entity *se)
> @@ -3120,17 +3144,6 @@ update_tg_cfs_load(struct cfs_rq *cfs_rq
> /* Update parent cfs_rq load */
> add_positive(&cfs_rq->avg.load_avg, delta);
> cfs_rq->avg.load_sum = cfs_rq->avg.load_avg * LOAD_AVG_MAX;
> -
> - /*
> - * If the sched_entity is already enqueued, we also have to update the
> - * runnable load avg.
> - */
> - if (se->on_rq) {
> - /* Update parent cfs_rq runnable_load_avg */
> - add_positive(&cfs_rq->avg.runnable_load_avg, delta);
> - cfs_rq->avg.runnable_load_sum =
> - cfs_rq->avg.runnable_load_avg * LOAD_AVG_MAX;
> - }
> }
>
> static inline void set_tg_cfs_propagate(struct cfs_rq *cfs_rq)
> @@ -3152,16 +3165,16 @@ static inline int test_and_clear_tg_cfs_
> /* Update task and its cfs_rq load average */
> static inline int propagate_entity_load_avg(struct sched_entity *se)
> {
> - struct cfs_rq *cfs_rq;
> + struct cfs_rq *cfs_rq = cfs_rq_of(se);
>
> if (entity_is_task(se))
> return 0;
>
> + update_tg_cfs_runnable(cfs_rq, se);
I wonder if update_tg_cfs_runnable() should really be called in
propagate_entity_load_avg().
propagate_entity_load_avg() is called on every update_load_avg because
of entity can be asynchronously detached so we must catch this
asynchronous events each time we update the load
But enqueue/dequeue of entity of fully synchronous and we know when
runnable_load_avg is updated and should be propagated. So instead of
calling update_tg_cfs_runnable() at every update_load_avg(), we can
only call it in the enque_/dequeue path and save lot of useless call
> +
next prev parent reply other threads:[~2017-05-05 16:51 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-04 20:28 [RFC PATCHSET v2] sched/fair: fix load balancer behavior when cgroup is in use Tejun Heo
2017-05-04 20:29 ` [PATCH 1/3] sched/fair: Peter's shares_type patch Tejun Heo
2017-05-05 10:40 ` Vincent Guittot
2017-05-05 15:30 ` Tejun Heo
2017-05-10 15:09 ` Tejun Heo
2017-05-10 16:07 ` Vincent Guittot
2017-05-11 6:59 ` Peter Zijlstra
2017-05-05 15:41 ` Peter Zijlstra
2017-05-04 20:29 ` [PATCH 2/3] sched/fair: Add load_weight->runnable_load_{sum|avg} Tejun Heo
2017-05-05 13:22 ` Dietmar Eggemann
2017-05-05 13:26 ` Tejun Heo
2017-05-05 13:37 ` Dietmar Eggemann
2017-05-04 20:30 ` [PATCH 3/3] sched/fair: Propagate runnable_load_avg independently from load_avg Tejun Heo
2017-05-05 10:42 ` Vincent Guittot
2017-05-05 12:18 ` Vincent Guittot
2017-05-05 13:26 ` Tejun Heo
2017-05-05 16:51 ` Vincent Guittot [this message]
2017-05-05 8:46 ` [RFC PATCHSET v2] sched/fair: fix load balancer behavior when cgroup is in use Vincent Guittot
2017-05-05 13:28 ` Tejun Heo
2017-05-05 13:32 ` 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=CAKfTPtAVOdyCxVMTXwBadtVWyiaLMjSeL8bTuLatZBxgAKJF2Q@mail.gmail.com \
--to=vincent.guittot@linaro.org \
--cc=clm@fb.com \
--cc=efault@gmx.de \
--cc=kernel-team@fb.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=pjt@google.com \
--cc=tj@kernel.org \
--cc=torvalds@linux-foundation.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;
as well as URLs for NNTP newsgroup(s).