From: Chris Redpath <Chris.Redpath@arm.com>
To: Vincent Guittot <vincent.guittot@linaro.org>,
"peterz@infradead.org" <peterz@infradead.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Cc: "mingo@kernel.org" <mingo@kernel.org>,
"pjt@google.com" <pjt@google.com>,
"bsegall@google.com" <bsegall@google.com>,
"linaro-kernel@lists.linaro.org" <linaro-kernel@lists.linaro.org>
Subject: Re: [PATCH] sched: fix sched_entity avg statistics update
Date: Wed, 22 Jan 2014 10:10:19 +0000 [thread overview]
Message-ID: <52DF990B.4060703@arm.com> (raw)
In-Reply-To: <1390320738-4555-1-git-send-email-vincent.guittot@linaro.org>
On 21/01/14 16:12, Vincent Guittot wrote:
> With the current implementation, the load average statistics of a sched entity
> change according to other activity on the CPU even if this activity is done
> between the running window of the sched entity and have no influence on the
> running duration of the task.
>
> When a task wakes up on the same CPU, we currently update last_runnable_update
> with the return of __synchronize_entity_decay without updating the
> runnable_avg_sum and runnable_avg_period accordingly. In fact, we have to sync
> the load_contrib of the se with the rq's blocked_load_contrib before removing
> it from the latter (with __synchronize_entity_decay) but we must keep
> last_runnable_update unchanged for updating runnable_avg_sum/period during the
> next update_entity_load_avg.
>
> Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
> ---
> kernel/sched/fair.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index e64b079..5b0ef90 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -2370,8 +2370,7 @@ static inline void enqueue_entity_load_avg(struct cfs_rq *cfs_rq,
> * would have made count negative); we must be careful to avoid
> * double-accounting blocked time after synchronizing decays.
> */
> - se->avg.last_runnable_update += __synchronize_entity_decay(se)
> - << 20;
> + __synchronize_entity_decay(se);
> }
>
> /* migrated tasks did not contribute to our blocked load */
>
I've noticed this problem too. It becomes more apparent if you are
closely inspecting load signals and comparing against ideal signals
generated from task runtime traces. IMO it should be fixed.
prev parent reply other threads:[~2014-01-22 10:10 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-21 16:12 [PATCH] sched: fix sched_entity avg statistics update Vincent Guittot
2014-01-21 18:38 ` bsegall
2014-01-21 20:06 ` Vincent Guittot
[not found] ` <CAKfTPtDEKnM+er0NLxCKN4gK_KP3hnzPd13k7qqYtyWKCgdP4w@mail.gmail.com>
2014-01-21 20:31 ` Paul Turner
2014-01-21 20:45 ` Peter Zijlstra
2014-01-22 7:45 ` [PATCH] Revert "sched: Fix sleep time double accounting in enqueue entity" Vincent Guittot
2014-01-22 7:50 ` Vincent Guittot
2014-01-22 17:53 ` bsegall
2014-01-22 19:54 ` Paul Turner
2014-01-23 16:46 ` [tip:sched/urgent] " tip-bot for Vincent Guittot
2014-01-22 10:10 ` Chris Redpath [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=52DF990B.4060703@arm.com \
--to=chris.redpath@arm.com \
--cc=bsegall@google.com \
--cc=linaro-kernel@lists.linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=pjt@google.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.