From: George Dunlap <george.dunlap@citrix.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
Hui Lv <hui.lv@intel.com>
Subject: Re: [PATCH] xen/sched_credit: Use delay to control scheduling frequency
Date: Tue, 20 Dec 2011 10:21:08 +0000 [thread overview]
Message-ID: <1324376468.2143.148.camel@elijah> (raw)
In-Reply-To: <1324372056.23729.8.camel@zakaz.uk.xensource.com>
On Tue, 2011-12-20 at 09:07 +0000, Ian Campbell wrote:
>
> > +/* Scheduler generic parameters
> > +*/
> > +extern int sched_ratelimit_us;
>
> If this is generic then it seems like xen/sched.h is the right place for
> it.
Yes, this should be declared in xen/include/xen/sched.h.
> Is it really generic though if only the credit scheduler applies it?
The concept is generic enough that I think saying, "This is the control,
not all schedulers implement it" makes sense. credit2 *may* in the
future have use for such a control; at which point it would be a bit
asinine to have two switches, named "credit_sched_ratelimit_us" and
"credit2_sched_ratelimit_us".
> > + /* If we have schedule rate limiting enabled, check to see
> > + * how long we've run for. */
> > + if ( !tasklet_work_scheduled
> > + && sched_ratelimit_us
> > + && vcpu_runnable(current)
> > + && !is_idle_vcpu(current)
> > + && runtime < MICROSECS(sched_ratelimit_us) )
> > + {
> > + snext = scurr;
> > + snext->start_time += now;
> > + perfc_incr(delay_ms);
> > + tslice = MICROSECS(sched_ratelimit_us);
> > + ret.migrated = 0;
> > + goto out;
> > + }
> > + else
> > + {
>
> This is the same comment as the next block below, does it really apply
> here too?
>
> Since the previous if block ends with a goto the else clause is a bit
> redundant.
Yeah, probably better w/o the else.
> > +/* Default scheduling rate limit: 1ms
> > + * It's not recommended to set this value bigger than "sched_credit_tslice_ms"
> > + * otherwise, something weired may happen
Hui, "something weird may happen" is fine for informal speech, but for
comments we tend to use more formal language. I might say something
like this:
"The behavior when sched_ratelimit_us is greater than
sched_credit_tslice_ms is undefined."
-George
next prev parent reply other threads:[~2011-12-20 10:21 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-19 22:13 [PATCH] xen/sched_credit: Use delay to control scheduling frequency Hui Lv
2011-12-20 9:07 ` Ian Campbell
2011-12-20 9:44 ` Lv, Hui
2011-12-20 10:09 ` Dario Faggioli
2011-12-20 10:26 ` George Dunlap
2011-12-20 10:51 ` Dario Faggioli
2011-12-20 12:14 ` Lv, Hui
2011-12-20 10:21 ` George Dunlap [this message]
-- strict thread matches above, loose matches on Subject: below --
2011-12-26 8:46 Hui Lv
2012-01-02 8:19 ` Jan Beulich
2012-01-05 4:08 ` Lv, Hui
2012-01-06 19:50 ` George Dunlap
2012-01-06 19:56 ` George Dunlap
2012-01-08 12:03 ` Lv, Hui
2012-01-09 9:49 ` George Dunlap
2012-01-09 10:22 Hui Lv
2012-01-10 10:05 ` George Dunlap
2012-01-24 12:01 ` George Dunlap
2012-01-24 14:17 ` Keir Fraser
2012-01-24 14:31 ` 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=1324376468.2143.148.camel@elijah \
--to=george.dunlap@citrix.com \
--cc=George.Dunlap@eu.citrix.com \
--cc=Ian.Campbell@citrix.com \
--cc=hui.lv@intel.com \
--cc=xen-devel@lists.xensource.com \
/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.