From: Dario Faggioli <dario.faggioli@citrix.com>
To: George Dunlap <George.Dunlap@eu.citrix.com>
Cc: Chong Li <chong.li@wustl.edu>, Sisu Xi <xisisu@gmail.com>,
"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
Meng Xu <mengxu@cis.upenn.edu>, Jan Beulich <jbeulich@suse.com>,
Chong Li <lichong659@gmail.com>,
Dagaen Golomb <dgolomb@seas.upenn.edu>
Subject: Re: [PATCH v2 for Xen 4.6 1/4] xen: enabling XL to set per-VCPU parameters of a domain for RTDS scheduler
Date: Thu, 4 Jun 2015 17:14:12 +0200 [thread overview]
Message-ID: <1433430852.6291.16.camel@citrix.com> (raw)
In-Reply-To: <CAFLBxZZDu5WkBYQR_bsWB=YVkLK0foM=08x_KAOmxwiM-CpEcQ@mail.gmail.com>
[-- Attachment #1.1: Type: text/plain, Size: 3394 bytes --]
On Tue, 2015-06-02 at 17:28 +0100, George Dunlap wrote:
> On Tue, May 26, 2015 at 1:05 AM, Chong Li <lichong659@gmail.com> wrote:
> > Add two hypercalls(XEN_DOMCTL_SCHEDOP_getvcpuinfo/putvcpuinfo) to get/set a domain's
> > per-VCPU parameters. Hypercalls are handled by newly added hook (.adjust_vcpu) in the
> > scheduler interface.
> >
> > Add a new data structure (struct xen_domctl_scheduler_vcpu_op) for transferring data
> > between tool and hypervisor.
> >
> > Signed-off-by: Chong Li <chong.li@wustl.edu>
> > Signed-off-by: Meng Xu <mengxu@cis.upenn.edu>
> > Signed-off-by: Sisu Xi <xisisu@gmail.com>
>
> One comment that I didn't see addressed already...
>
> > + switch ( op->cmd )
> > + {
> > + case XEN_DOMCTL_SCHEDOP_getvcpuinfo:
> > + spin_lock_irqsave(&prv->lock, flags);
> > + list_for_each( iter, &sdom->vcpu )
> > + {
> > + svc = list_entry(iter, struct rt_vcpu, sdom_elem);
> > + vcpuid = svc->vcpu->vcpu_id;
> > +
> > + local_sched.budget = svc->budget / MICROSECS(1);
> > + local_sched.period = svc->period / MICROSECS(1);
> > + if ( copy_to_guest_offset(op->u.rtds.vcpus, vcpuid,
> > + &local_sched, 1) )
> > + {
> > + spin_unlock_irqrestore(&prv->lock, flags);
> > + return -EFAULT;
> > + }
> > + hypercall_preempt_check();
> > + }
> > + spin_unlock_irqrestore(&prv->lock, flags);
> > + break;
> > + case XEN_DOMCTL_SCHEDOP_putvcpuinfo:
> > + spin_lock_irqsave(&prv->lock, flags);
> > + for( i = 0; i < op->u.rtds.nr_vcpus; i++ )
> > + {
> > + if ( copy_from_guest_offset(&local_sched,
> > + op->u.rtds.vcpus, i, 1) )
> > + {
> > + spin_unlock_irqrestore(&prv->lock, flags);
> > + return -EFAULT;
> > + }
> > + if ( local_sched.period <= 0 || local_sched.budget <= 0 )
> > + {
> > + spin_unlock_irqrestore(&prv->lock, flags);
> > + return -EINVAL;
> > + }
> > + svc = rt_vcpu(d->vcpu[local_sched.vcpuid]);
> > + svc->period = MICROSECS(local_sched.period);
> > + svc->budget = MICROSECS(local_sched.budget);
> > + hypercall_preempt_check();
> > + }
>
> It looks like the interface here is assymetric. That is, on
> "putvcpuinfo", you assume there is an array of rtds.nr_vcpus length,
> and you read vcpu_id from each one. In "getvcpuinfo", you assume that
> the array is the number of vcpus in the guest, and you just copy all
> the vcpu data into it.
>
> I think it would make more sense for it to work the same both ways --
> so either always pass an array of all vcpus of the guest in and out;
> or, have an array potentially specifying a subset of cpus in and out.
>
> Thoughts?
>
It would indeed. And in fact, just FTR, I did say pretty much the same
in <1432904488.5077.30.camel@citrix.com> :-D
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
prev parent reply other threads:[~2015-06-04 15:14 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-26 0:05 [PATCH v2 for Xen 4.6 1/4] xen: enabling XL to set per-VCPU parameters of a domain for RTDS scheduler Chong Li
2015-05-26 9:08 ` Jan Beulich
2015-05-26 17:18 ` Chong Li
2015-05-27 5:33 ` Chong Li
2015-05-27 11:42 ` Jan Beulich
2015-05-27 11:41 ` Jan Beulich
2015-05-29 13:01 ` Dario Faggioli
2015-05-29 13:14 ` Jan Beulich
2015-06-04 15:27 ` Dario Faggioli
2015-05-27 10:02 ` Chao Peng
2015-05-27 22:16 ` Chong Li
2015-05-29 13:51 ` Dario Faggioli
2015-05-29 16:47 ` Chong Li
2015-06-04 15:10 ` Dario Faggioli
2015-06-02 16:06 ` George Dunlap
2015-06-02 16:28 ` George Dunlap
2015-06-04 15:14 ` Dario Faggioli [this message]
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=1433430852.6291.16.camel@citrix.com \
--to=dario.faggioli@citrix.com \
--cc=George.Dunlap@eu.citrix.com \
--cc=chong.li@wustl.edu \
--cc=dgolomb@seas.upenn.edu \
--cc=jbeulich@suse.com \
--cc=lichong659@gmail.com \
--cc=mengxu@cis.upenn.edu \
--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 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.