From: George Dunlap <george.dunlap@citrix.com>
To: Dario Faggioli <dario.faggioli@citrix.com>,
xen-devel@lists.xenproject.org
Cc: Wei Liu <wei.liu2@citrix.com>
Subject: Re: [PATCH for 4.7 3/4] xen: credit2: fix 2 (minor) issues in load tracking logic
Date: Wed, 4 May 2016 16:38:12 +0100 [thread overview]
Message-ID: <572A1764.7080707@citrix.com> (raw)
In-Reply-To: <146231201072.25631.4767945168905205742.stgit@Solace.fritz.box>
On 03/05/16 22:46, Dario Faggioli wrote:
> All calculations that involve load_last_update uses quantities
> shifted by LOADAVG_GRANULARITY_SHIFT, so make sure that this
> is true even when the field is assigned a value for the first
> time, during vcpu allocation.
>
> Also, during migration, while the loads of both the source and
> destination runqueues certainly need changing, the vcpu being
> moved does not change its running/non-running status, and its
> calculated load should hence not be affected.
>
> Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Looks good, thanks.
Reviewed-by: George Dunlap <george.dunlap@citrix.com>
I suppose the code that sets 'svc->load_last_update = now' should
probably have changed the variable name to make it clear that now !=
NOW(). Maybe next time I'm looking through that code I'll do a bit of
renaming.
> ---
> Cc: George Dunlap <george.dunlap@citrix.com>
> Cc: Wei Liu <wei.liu2@citrix.com>
> ---
> xen/common/sched_credit2.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/xen/common/sched_credit2.c b/xen/common/sched_credit2.c
> index 803cc44..393364a 100644
> --- a/xen/common/sched_credit2.c
> +++ b/xen/common/sched_credit2.c
> @@ -867,7 +867,7 @@ csched2_alloc_vdata(const struct scheduler *ops, struct vcpu *vc, void *dd)
> svc->weight = svc->sdom->weight;
> /* Starting load of 50% */
> svc->avgload = 1ULL << (CSCHED2_PRIV(ops)->load_window_shift - 1);
> - svc->load_last_update = NOW();
> + svc->load_last_update = NOW() >> LOADAVG_GRANULARITY_SHIFT;
> }
> else
> {
> @@ -1301,7 +1301,7 @@ static void migrate(const struct scheduler *ops,
> if ( __vcpu_on_runq(svc) )
> {
> __runq_remove(svc);
> - update_load(ops, svc->rqd, svc, -1, now);
> + update_load(ops, svc->rqd, NULL, -1, now);
> on_runq=1;
> }
> __runq_deassign(svc);
> @@ -1314,7 +1314,7 @@ static void migrate(const struct scheduler *ops,
> __runq_assign(svc, trqd);
> if ( on_runq )
> {
> - update_load(ops, svc->rqd, svc, 1, now);
> + update_load(ops, svc->rqd, NULL, 1, now);
> runq_insert(ops, svc->vcpu->processor, svc);
> runq_tickle(ops, svc->vcpu->processor, svc, now);
> SCHED_STAT_CRANK(migrate_on_runq);
>
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
next prev parent reply other threads:[~2016-05-04 15:38 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-03 21:46 [PATCH for 4.7 0/4] Assorted scheduling fixes Dario Faggioli
2016-05-03 21:46 ` [PATCH for 4.7 1/4] xen: sched: avoid spuriously re-enabling IRQs in csched2_switch_sched() Dario Faggioli
2016-05-04 8:48 ` Jan Beulich
2016-05-04 9:08 ` Dario Faggioli
2016-05-04 15:11 ` George Dunlap
2016-05-04 15:58 ` Dario Faggioli
2016-05-04 17:05 ` George Dunlap
2016-05-04 17:21 ` Dario Faggioli
2016-05-04 17:34 ` George Dunlap
2016-05-06 13:21 ` Dario Faggioli
2016-05-06 13:48 ` Wei Liu
2016-05-09 14:42 ` George Dunlap
2016-05-03 21:46 ` [PATCH for 4.7 2/4] xen: sched: fix killing an uninitialized timer in free_pdata Dario Faggioli
2016-05-04 15:25 ` George Dunlap
2016-05-03 21:46 ` [PATCH for 4.7 3/4] xen: credit2: fix 2 (minor) issues in load tracking logic Dario Faggioli
2016-05-04 15:38 ` George Dunlap [this message]
2016-05-03 21:46 ` [PATCH for 4.7 4/4] xen: adopt .deinit_pdata and improve timer handling Dario Faggioli
2016-05-04 15:51 ` George Dunlap
2016-05-04 15:53 ` Meng Xu
2016-05-06 23:05 ` Dario Faggioli
2016-05-07 21:19 ` Meng Xu
2016-05-08 3:12 ` Meng Xu
2016-05-09 8:07 ` Juergen Gross
2016-05-09 13:22 ` Dario Faggioli
2016-05-09 14:08 ` Meng Xu
2016-05-09 14:52 ` Dario Faggioli
2016-05-09 14:58 ` Meng Xu
2016-05-09 14:46 ` George Dunlap
2016-05-09 14:58 ` Wei Liu
2016-05-09 15:35 ` George Dunlap
2016-05-04 1:26 ` [PATCH for 4.7 0/4] Assorted scheduling fixes Konrad Rzeszutek Wilk
2016-05-04 9:06 ` Dario Faggioli
2016-05-05 12:00 ` Julien Grall
2016-05-05 12:38 ` Dario Faggioli
2016-05-04 15:53 ` George Dunlap
2016-05-04 16:04 ` Wei Liu
2016-05-07 21:23 ` Meng Xu
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=572A1764.7080707@citrix.com \
--to=george.dunlap@citrix.com \
--cc=dario.faggioli@citrix.com \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xenproject.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).