All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dario Faggioli <dario.faggioli@citrix.com>
To: George Dunlap <George.Dunlap@eu.citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>,
	Sisu Xi <xisisu@gmail.com>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
	Ian Jackson <ian.jackson@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Meng Xu <xumengpanda@gmail.com>, Meng Xu <mengxu@cis.upenn.edu>,
	Jan Beulich <JBeulich@suse.com>, Chao Wang <chaowang@wustl.edu>,
	Chong Li <lichong659@gmail.com>,
	Dagaen Golomb <dgolomb@seas.upenn.edu>
Subject: Re: [PATCH v1 1/4] xen: add real time scheduler rt
Date: Wed, 3 Sep 2014 18:57:30 +0200	[thread overview]
Message-ID: <1409763450.2673.140.camel@Solace.lan> (raw)
In-Reply-To: <CAFLBxZZhx3As_c5+AOWG+1ADCoa6Cqe2E0tXX=cZNgL9JqdaLQ@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 5822 bytes --]

On mer, 2014-09-03 at 17:06 +0100, George Dunlap wrote:
> On Wed, Sep 3, 2014 at 4:13 PM, Meng Xu <xumengpanda@gmail.com> wrote:
> > Hi George,
> >
> >
> > 2014-09-03 10:20 GMT-04:00 George Dunlap <George.Dunlap@eu.citrix.com>:
> >
> >> On Sun, Aug 24, 2014 at 11:58 PM, Meng Xu <mengxu@cis.upenn.edu> wrote:
> >> > diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h
> >> > index 5b11bbf..27d01c1 100644
> >> > --- a/xen/include/public/domctl.h
> >> > +++ b/xen/include/public/domctl.h
> >> > @@ -339,6 +339,19 @@ struct xen_domctl_max_vcpus {
> >> >  typedef struct xen_domctl_max_vcpus xen_domctl_max_vcpus_t;
> >> >  DEFINE_XEN_GUEST_HANDLE(xen_domctl_max_vcpus_t);
> >> >
> >> > +/*
> >> > + * This structure is used to pass to rt scheduler from a
> >> > + * privileged domain to Xen
> >> > + */
> >> > +struct xen_domctl_sched_rt_params {
> >> > +    /* get vcpus' info */
> >> > +    uint64_t period; /* s_time_t type */
> >> > +    uint64_t budget;
> >> > +    uint16_t index;
> >> > +    uint16_t padding[3];
> >>
> >> Why the padding?
> >>
> >
> > I did this because of Jan's comment "Also, you need to pad the structure to
> > a multiple of 8 bytes, or
> > its layout will differ between 32- and 64-bit (tool stack) callers." I think
> > what he said make sense so I added the padding here. :-)
> >
> > Here is the link: http://marc.info/?l=xen-devel&m=140661680931179&w=2
> 
> Right. :-)  I personally prefer to handle that by re-arranging the
> elements rather than adding padding, unless absolutely necessary.  In
> this case that shouldn't be too hard, particularly once we pare the
> interface down so we only have one interface (either all one vcpu at a
> time, or all batched vcpus).
> 
> > I think it's a better idea to
> >  pass in an array with information about vcpus to get/set vcpus'
> > information.
> >
> > I only need to change the code related to setting a vcpu's information.
> > I have a question:
> > When we set a vcpu's information by using an array, we have two choices:
> >
> > a) just create an array with one vcpu element, and specify the index of the
> > vcpu to modify; The concern to this method is that we only uses one element
> > of this array, so is it a good idea to use an array with only one element?
> > b) create an array with all vcpus of this domain, modify the parameters of
> > the vcpu users want to change, and then bounce the array to hypervisor to
> > reset these vcpus' parameters. The concern to this method is that we don't
> > need any other vcpus' information to set a specific vcpu's parameters.
> > Bouncing the whole array with all vcpus information seems expensive and
> > unnecessary?
> >
> > Do you have any suggestion/advice/preference on this?
> >
> > I don't really like about the idea of reading the vcpu's information
> > one-by-one. :-) If a domain has many vcpus, say 12 vcpus, we will issue 12
> > hypercalls to get all vcpus' information of this domain. Because we only
> > need to issue one hypercall to get all information we want, the extra
> > hypercalls causes more overhead. This did simplify the implementation, but
> > may cause more overhead.
> 
> For convenience for users, I think it's definitely the case that libxl
> should provide an interface to get and set all the vcpu parameters at
> once.  Then it can either batch them all into a single hypercall (if
> that's what we decide), or it can make the individual calls for each
> vcpu.
> 
Indeed.

> The main reason I would think to batch the hypercalls is for
> consistency: it seems like you may want to change the period / budget
> of vcpus atomically, rather than setting one, possibly having dom0
> de-scheduled for a few hundred milliseconds, and then setting another.
> Same thing goes for reading: I would think you would want a consistent
> "snapshot" of some existing state, rather than having the possibility
> of reading half the state, then having someone change it, and then
> reading the other half.
> 
That is actually the reason why I'd have both things. A "change this
one" variant is handy if one actually had to change only one vcpu, or a
few, but does not mind the non-atomicity.

The batched variant, for both overhead and atomicity reasons.

> Re the per-vcpu settings, though: Is it really that common for RT
> domains to want different parameters for different vcpus?  
>
Whether it's common it is hard to say, but yes, it has to be possible. 

For instance, I can put, in an SMP guest, two real-time applications
with different timing requirements, and pin each one to a different
(v)cpu (I mean pin *inside* the guest). At this point, I'd like for each
vcpu to have a set of RT scheduling parameters, at the Xen level, that
matches the timing requirements of what's running inside.

This may not look so typical in a server/cloud environment, but can
happen (at least in my experience) in a mobile/embedded env.

> Are these
> parameters exposed to the guest in any way, so that it can make more
> reasonable decisions as to where to run what kinds of workloads?
> 
Not right now, AFAICS, but forms of 'scheduling paravirtualization', or
in general this kind of interaction/communication could be very useful
in real-time virtualization, so we may want to support that in future.

In any case, even without that in place right now, I think different
parameters for different vcpus is certainly something we want from an RT
scheduler.

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: 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

  reply	other threads:[~2014-09-03 16:57 UTC|newest]

Thread overview: 72+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-24 22:58 Introduce rt real-time scheduler for Xen Meng Xu
2014-08-24 22:58 ` [PATCH v1 1/4] xen: add real time scheduler rt Meng Xu
2014-08-26 14:27   ` Jan Beulich
2014-08-27  2:07     ` Meng Xu
2014-08-27  6:26       ` Jan Beulich
2014-08-27 14:28         ` Meng Xu
2014-08-27 15:04           ` Jan Beulich
2014-08-28 16:06             ` Meng Xu
2014-08-29  9:05               ` Jan Beulich
2014-08-29 19:35                 ` Meng Xu
2014-09-03 14:08                 ` George Dunlap
2014-09-03 14:24                   ` Meng Xu
2014-09-03 14:35                     ` Dario Faggioli
2014-09-03 13:40   ` George Dunlap
2014-09-03 14:11     ` Meng Xu
2014-09-03 14:15       ` George Dunlap
2014-09-03 14:35         ` Meng Xu
2014-09-05  9:46     ` Dario Faggioli
2014-09-03 14:20   ` George Dunlap
2014-09-03 14:45     ` Jan Beulich
2014-09-03 14:59     ` Dario Faggioli
2014-09-03 15:27       ` Meng Xu
2014-09-03 15:46         ` Dario Faggioli
2014-09-03 17:13           ` George Dunlap
2014-09-03 15:13     ` Meng Xu
2014-09-03 16:06       ` George Dunlap
2014-09-03 16:57         ` Dario Faggioli [this message]
2014-09-03 17:18           ` George Dunlap
2014-09-04  2:15             ` Meng Xu
2014-09-04 14:27             ` Dario Faggioli
2014-09-04 15:30               ` Meng Xu
2014-09-05  9:36                 ` Dario Faggioli
2014-09-05 15:06                   ` Meng Xu
2014-09-05 15:09                     ` Dario Faggioli
2014-09-04  2:11         ` Meng Xu
2014-09-04 11:00           ` Dario Faggioli
2014-09-04 13:03           ` George Dunlap
2014-09-04 14:00             ` Meng Xu
2014-09-05 17:17   ` Dario Faggioli
2014-09-07  3:56     ` Meng Xu
2014-09-08 10:33       ` Dario Faggioli
2014-09-09 13:43         ` Meng Xu
2014-08-24 22:58 ` [PATCH v1 2/4] libxc: add rt scheduler Meng Xu
2014-09-05 10:34   ` Dario Faggioli
2014-09-05 17:17     ` Meng Xu
2014-09-05 17:50       ` Dario Faggioli
2014-08-24 22:58 ` [PATCH v1 3/4] libxl: " Meng Xu
2014-08-25 13:17   ` Wei Liu
2014-08-25 15:55     ` Meng Xu
2014-08-26  9:51       ` Wei Liu
2014-09-03 15:33   ` George Dunlap
2014-09-03 20:52     ` Meng Xu
2014-09-04 14:27     ` George Dunlap
2014-09-04 14:45       ` Dario Faggioli
2014-09-04 14:47       ` Meng Xu
2014-09-04 14:51         ` George Dunlap
2014-09-04 15:07           ` Meng Xu
2014-09-04 15:44             ` Dario Faggioli
2014-09-04 15:55               ` George Dunlap
2014-09-04 16:12                 ` Meng Xu
2014-09-05  9:19                   ` Dario Faggioli
2014-09-04 15:25         ` Dario Faggioli
2014-09-05 10:21   ` Dario Faggioli
2014-09-05 15:45     ` Meng Xu
2014-09-05 17:41       ` Dario Faggioli
2014-08-24 22:58 ` [PATCH v1 4/4] xl: introduce " Meng Xu
2014-08-25 13:31   ` Wei Liu
2014-08-25 16:12     ` Meng Xu
2014-09-03 15:52   ` George Dunlap
2014-09-03 22:28     ` Meng Xu
2014-09-05  9:40       ` Dario Faggioli
2014-09-05 14:43         ` 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=1409763450.2673.140.camel@Solace.lan \
    --to=dario.faggioli@citrix.com \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=JBeulich@suse.com \
    --cc=chaowang@wustl.edu \
    --cc=dgolomb@seas.upenn.edu \
    --cc=ian.campbell@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=lichong659@gmail.com \
    --cc=mengxu@cis.upenn.edu \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=xen-devel@lists.xen.org \
    --cc=xisisu@gmail.com \
    --cc=xumengpanda@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 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.