From: Jayson King <dev@jaysonking.com>
To: Mike Galbraith <efault@gmx.de>
Cc: linux-kernel@vger.kernel.org, a.p.zijlstra@chello.nl, mingo@elte.hu
Subject: Re: [patch] Re: problem with "sched: revert back to per-rq vruntime"?
Date: Thu, 01 Jan 2009 18:14:40 -0600 [thread overview]
Message-ID: <495D5C70.4090804@jaysonking.com> (raw)
In-Reply-To: <1230795963.5892.14.camel@marge.simson.net>
Mike Galbraith wrote:
> Would perhaps be prettier to have the load already in place at call
> time, but methinks the enqueue/dequeue accounting logic is nice as is,
> so complete the unlikely case handling in an unlikely block.
>
> Impact: bug fixlet.
>
> Account for tasks which have not yet been enqueued in calc_delta_weight().
>
> Signed-off-by: Mike Galbraith <efault@gmx.de>
>
> diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c
> index 5ad4440..4685f28 100644
> --- a/kernel/sched_fair.c
> +++ b/kernel/sched_fair.c
> @@ -392,8 +392,16 @@ static inline unsigned long
> calc_delta_weight(unsigned long delta, struct sched_entity *se)
> {
> for_each_sched_entity(se) {
> - delta = calc_delta_mine(delta,
> - se->load.weight, &cfs_rq_of(se)->load);
> + struct load_weight *load = &cfs_rq_of(se)->load;
> +
> + if (unlikely(!se->on_rq)) {
> + struct load_weight tmp;
> +
> + tmp.weight = load->weight + se->load.weight;
> + tmp.inv_weight = 0;
> + load = &tmp;
> + }
> + delta = calc_delta_mine(delta, se->load.weight, load);
> }
>
> return delta;
>
>
Still works OK for me. You may add, if you like:
Tested-By: Jayson King <dev@jaysonking.com>
Jayson
next prev parent reply other threads:[~2009-01-02 0:12 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-29 22:02 problem with "sched: revert back to per-rq vruntime"? Jayson King
2008-12-29 22:11 ` Jayson King
2008-12-30 19:37 ` Jayson King
2008-12-31 16:26 ` Mike Galbraith
2008-12-31 20:17 ` Jayson King
2009-01-01 7:46 ` [patch] " Mike Galbraith
2009-01-02 0:14 ` Jayson King [this message]
2009-01-02 11:16 ` Mike Galbraith
2009-01-02 20:38 ` Jayson King
2009-01-05 7:54 ` 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=495D5C70.4090804@jaysonking.com \
--to=dev@jaysonking.com \
--cc=a.p.zijlstra@chello.nl \
--cc=efault@gmx.de \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
/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.