From: Dario Faggioli <dario.faggioli@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
xen-devel <xen-devel@lists.xen.org>
Subject: Re: [PATCH] credit: track residual from divisions done during accounting
Date: Fri, 22 Feb 2013 18:26:43 +0100 [thread overview]
Message-ID: <1361554003.16232.33.camel@Solace> (raw)
In-Reply-To: <51222E8302000078000BF1F3@nat28.tlf.novell.com>
[-- Attachment #1.1: Type: text/plain, Size: 1166 bytes --]
On Mon, 2013-02-18 at 12:37 +0000, Jan Beulich wrote:
> --- a/xen/common/sched_credit.c
> +++ b/xen/common/sched_credit.c
>
> @@ -242,6 +244,7 @@ __runq_remove(struct csched_vcpu *svc)
> static void burn_credits(struct csched_vcpu *svc, s_time_t now)
> {
> s_time_t delta;
> + uint64_t val;
> unsigned int credits;
>
> /* Assert svc is current */
> @@ -250,7 +253,10 @@ static void burn_credits(struct csched_v
> if ( (delta = now - svc->start_time) <= 0 )
> return;
>
> - credits = (delta*CSCHED_CREDITS_PER_MSEC + MILLISECS(1)/2) / MILLISECS(1);
> + val = delta * CSCHED_CREDITS_PER_MSEC + svc->residual;
> + svc->residual = do_div(val, MILLISECS(1));
> + credits = val;
> + ASSERT(credits == val);
I may be missing something, but how can the assert ever be false, given
the assignment right before it?
Regards,
Dario
--
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://about.me/dario.faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)
[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
[-- Attachment #2: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
next prev parent reply other threads:[~2013-02-22 17:26 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-18 12:37 [PATCH] credit: track residual from divisions done during accounting Jan Beulich
2013-02-22 17:26 ` Dario Faggioli [this message]
2013-02-25 9:29 ` Jan Beulich
2013-02-25 10:45 ` Dario Faggioli
2013-02-25 11:12 ` David Vrabel
2013-02-25 11:30 ` Jan Beulich
2013-02-26 11:26 ` George Dunlap
2013-02-26 11:46 ` Jan Beulich
2013-02-26 11:52 ` Tim Deegan
2013-02-26 12:00 ` David Vrabel
2013-02-26 12:21 ` Ian Campbell
2013-02-26 12:51 ` Jan Beulich
2013-02-26 13:10 ` Ian Campbell
2013-02-26 12:54 ` George Dunlap
2013-02-26 13:46 ` Tim Deegan
2013-02-26 15:00 ` George Dunlap
2013-02-26 15:07 ` Jan Beulich
2013-02-26 15:11 ` George Dunlap
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=1361554003.16232.33.camel@Solace \
--to=dario.faggioli@citrix.com \
--cc=George.Dunlap@eu.citrix.com \
--cc=JBeulich@suse.com \
--cc=xen-devel@lists.xen.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.