From: Dario Faggioli <dario.faggioli@citrix.com>
To: Chong Li <lichong659@gmail.com>
Cc: Chong Li <chong.li@wustl.edu>, Wei Liu <wei.liu2@citrix.com>,
Sisu Xi <xisisu@gmail.com>,
"george.dunlap" <george.dunlap@eu.citrix.com>,
xen-devel <xen-devel@lists.xen.org>,
Meng Xu <mengxu@cis.upenn.edu>, Jan Beulich <JBeulich@suse.com>,
Dagaen Golomb <dgolomb@seas.upenn.edu>
Subject: Re: [PATCH v1 1/4] xen: enabling XL to set per-VCPU parameters of a domain for RTDS scheduler
Date: Fri, 15 May 2015 16:42:42 +0200 [thread overview]
Message-ID: <1431700962.2978.180.camel@citrix.com> (raw)
In-Reply-To: <CAGHO-iosmqj3odmpTXkZrvp2G8QALa3OxA8aU1Aays4Zazkc-w@mail.gmail.com>
[-- Attachment #1.1: Type: text/plain, Size: 3840 bytes --]
Hey,
2 things first:
- can you avoid HTML emails?
- can you trim the quotes, which means only leaving in the reply
message the bits of the conversation that are useful for bringing it
forward, and cut the rest (I'm doing this in this mail too)
On Thu, 2015-05-14 at 17:27 -0500, Chong Li wrote:
> On Mon, May 11, 2015 at 1:57 AM, Jan Beulich <JBeulich@suse.com>
> wrote:
> >>> On 11.05.15 at 00:04, <lichong659@gmail.com> wrote:
> > On Fri, May 8, 2015 at 2:49 AM, Jan Beulich
> <JBeulich@suse.com>
>
> >> Considering a maximum size guest, these two nested loops
> could
> >> require a couple of million iterations. That's too much
> without any
> >> preemption checks in the middle.
> >>
> >
> > The section protected by the lock is only the
> "list_for_each" loop, whose
> > running time is limited by the number of vcpus of a domain
> (32 at most).
> Since when is 32 the limit on the number of vCPU-s in a
> domain?
> Based on Dario's suggestion, I'll use vcpu_id to locate the vcpu to
> set, which cost much
> less time.
>
I will indeed be quicker. However, this is probably not enough to
invalidate Jan's point: a guest can have enough vCPUs to make it
undesirable that the hypervisor goes doing something on each of them
without interruption/preemption.
In fact, even with only one for loop, the number of iterations may still
be high and, more important, is not under our (read: Xen) complete
control, as it depends on how many vCPUs the user is operating on.
For this reason, I think we also want to make this preemptable, at least
if the number of vCPUs passed is above a threshold that we can define.
Or perhaps by doing a bunch of vCPUs, tell toolstack how far we got and
have them reissue the hypercall.
Here's some (rather random) references:
* http://xenbits.xen.org/xsa/advisory-77.html
* http://xenbits.xen.org/xsa/advisory-125.html
* http://lists.xenproject.org/archives/html/xen-devel/2014-12/msg00735.html
* how the recently introduced XEN_SYSCTL_pcitopoinfo has been implemented
Regards,
Dario
>
>
> > If this does cause problems, I think adding a
> "hypercall_preempt_check()"
> > at the outside "for" loop may help. Is that right?
>
> Yes.
>
> >> > --- a/xen/common/schedule.c
> >> > +++ b/xen/common/schedule.c
> >> > @@ -1093,7 +1093,9 @@ long sched_adjust(struct domain *d,
> struct
> >> xen_domctl_scheduler_op *op)
> >> >
> >> > if ( (op->sched_id != DOM2OP(d)->sched_id) ||
> >> > ((op->cmd != XEN_DOMCTL_SCHEDOP_putinfo) &&
> >> > - (op->cmd != XEN_DOMCTL_SCHEDOP_getinfo)) )
> >> > + (op->cmd != XEN_DOMCTL_SCHEDOP_getinfo) &&
> >> > + (op->cmd != XEN_DOMCTL_SCHEDOP_putvcpuinfo) &&
> >> > + (op->cmd != XEN_DOMCTL_SCHEDOP_getvcpuinfo)) )
> >>
> >> Imo this should become a switch now.
> >>
> >
> > Do you mean "switch ( op->cmd )" ? I'm afraid that would
> make it look more
> > complicated.
>
> This may be a matter of taste to a certain degree, but I
> personally
> don't think a series of four almost identical comparisons
> reads any
> better than its switch() replacement. But it being a style
> issue, the
> ultimate decision is with George as the maintainer anyway.
>
> Jan
>
>
>
>
> --
> Chong Li
> Department of Computer Science and Engineering
> Washington University in St.louis
[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 181 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:[~2015-05-15 14:42 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-07 17:05 [PATCH v1 0/4] Enabling XL to set per-VCPU parameters of a domain for RTDS scheduler Chong Li
2015-05-07 17:05 ` [PATCH v1 1/4] xen: enabling " Chong Li
2015-05-08 7:49 ` Jan Beulich
2015-05-10 22:04 ` Chong Li
2015-05-11 6:57 ` Jan Beulich
2015-05-14 22:27 ` Chong Li
2015-05-15 14:42 ` Dario Faggioli [this message]
2015-05-11 13:11 ` Dario Faggioli
2015-05-14 22:15 ` Chong Li
2015-05-07 17:05 ` [PATCH v1 2/4] libxc: " Chong Li
2015-05-11 13:27 ` Dario Faggioli
2015-05-07 17:05 ` [PATCH v1 3/4] libxl: " Chong Li
2015-05-11 14:06 ` Dario Faggioli
2015-05-15 15:24 ` Chong Li
2015-05-15 23:09 ` Dario Faggioli
2015-05-12 10:01 ` Dario Faggioli
2015-05-15 16:35 ` Chong Li
2015-05-15 23:02 ` Dario Faggioli
2015-05-22 17:57 ` Chong Li
2015-05-07 17:05 ` [PATCH v1 4/4] xl: " Chong Li
2015-05-14 14:24 ` Meng Xu
2015-05-14 14:39 ` Dario Faggioli
2015-05-14 14:43 ` Meng Xu
2015-05-11 9:56 ` [PATCH v1 0/4] Enabling " Dario Faggioli
2015-05-14 17:08 ` Chong Li
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=1431700962.2978.180.camel@citrix.com \
--to=dario.faggioli@citrix.com \
--cc=JBeulich@suse.com \
--cc=chong.li@wustl.edu \
--cc=dgolomb@seas.upenn.edu \
--cc=george.dunlap@eu.citrix.com \
--cc=lichong659@gmail.com \
--cc=mengxu@cis.upenn.edu \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xen.org \
--cc=xisisu@gmail.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 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).