* [PATCH v2 for Xen 4.6 2/4] libxc: enabling XL to set per-VCPU parameters of a domain for RTDS scheduler
@ 2015-05-26 0:07 Chong Li
2015-06-05 11:23 ` Ian Campbell
0 siblings, 1 reply; 2+ messages in thread
From: Chong Li @ 2015-05-26 0:07 UTC (permalink / raw)
To: xen-devel
Cc: Chong Li, wei.liu2, Sisu Xi, george.dunlap, dario.faggioli,
mengxu, lichong659, dgolomb
Add xc_sched_rtds_vcpu_get/set functions to interact with Xen to get/set a domain's
per-VCPU parameters.
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>
---
tools/libxc/include/xenctrl.h | 9 ++++++++
tools/libxc/xc_rt.c | 53 +++++++++++++++++++++++++++++++++++++++++++
2 files changed, 62 insertions(+)
diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h
index 6994c51..45cbf91 100644
--- a/tools/libxc/include/xenctrl.h
+++ b/tools/libxc/include/xenctrl.h
@@ -892,6 +892,15 @@ int xc_sched_rtds_domain_get(xc_interface *xch,
uint32_t domid,
struct xen_domctl_sched_rtds *sdom);
+int xc_sched_rtds_vcpu_set(xc_interface *xch,
+ uint32_t domid,
+ struct xen_domctl_sched_rtds_params *sdom,
+ uint16_t num_vcpus);
+int xc_sched_rtds_vcpu_get(xc_interface *xch,
+ uint32_t domid,
+ struct xen_domctl_sched_rtds_params *sdom,
+ uint16_t num_vcpus);
+
int
xc_sched_arinc653_schedule_set(
xc_interface *xch,
diff --git a/tools/libxc/xc_rt.c b/tools/libxc/xc_rt.c
index b2d1cc5..42aea22 100644
--- a/tools/libxc/xc_rt.c
+++ b/tools/libxc/xc_rt.c
@@ -63,3 +63,56 @@ int xc_sched_rtds_domain_get(xc_interface *xch,
return rc;
}
+
+int xc_sched_rtds_vcpu_set(xc_interface *xch,
+ uint32_t domid,
+ struct xen_domctl_sched_rtds_params *sdom,
+ uint16_t num_vcpus)
+{
+ int rc;
+ DECLARE_DOMCTL;
+ DECLARE_HYPERCALL_BOUNCE(sdom, sizeof(*sdom) * num_vcpus,
+ XC_HYPERCALL_BUFFER_BOUNCE_IN);
+ if ( xc_hypercall_bounce_pre(xch, sdom) )
+ return -1;
+
+ domctl.cmd = XEN_DOMCTL_scheduler_vcpu_op;
+ domctl.domain = (domid_t) domid;
+ domctl.u.scheduler_vcpu_op.sched_id = XEN_SCHEDULER_RTDS;
+ domctl.u.scheduler_vcpu_op.cmd = XEN_DOMCTL_SCHEDOP_putvcpuinfo;
+ domctl.u.scheduler_vcpu_op.u.rtds.nr_vcpus = num_vcpus;
+ set_xen_guest_handle(domctl.u.scheduler_vcpu_op.u.rtds.vcpus, sdom);
+
+ rc = do_domctl(xch, &domctl);
+
+ xc_hypercall_bounce_post(xch, sdom);
+
+ return rc;
+}
+
+int xc_sched_rtds_vcpu_get(xc_interface *xch,
+ uint32_t domid,
+ struct xen_domctl_sched_rtds_params *sdom,
+ uint16_t num_vcpus)
+{
+ int rc;
+ DECLARE_DOMCTL;
+ DECLARE_HYPERCALL_BOUNCE(sdom, sizeof(*sdom) * num_vcpus,
+ XC_HYPERCALL_BUFFER_BOUNCE_OUT);
+
+ if ( xc_hypercall_bounce_pre(xch, sdom) )
+ return -1;
+
+ domctl.cmd = XEN_DOMCTL_scheduler_vcpu_op;
+ domctl.domain = (domid_t) domid;
+ domctl.u.scheduler_vcpu_op.sched_id = XEN_SCHEDULER_RTDS;
+ domctl.u.scheduler_vcpu_op.cmd = XEN_DOMCTL_SCHEDOP_getvcpuinfo;
+ domctl.u.scheduler_vcpu_op.u.rtds.nr_vcpus=num_vcpus;
+ set_xen_guest_handle(domctl.u.scheduler_vcpu_op.u.rtds.vcpus, sdom);
+
+ rc = do_domctl(xch, &domctl);
+
+ xc_hypercall_bounce_post(xch, sdom);
+
+ return rc;
+}
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2 for Xen 4.6 2/4] libxc: enabling XL to set per-VCPU parameters of a domain for RTDS scheduler
2015-05-26 0:07 [PATCH v2 for Xen 4.6 2/4] libxc: enabling XL to set per-VCPU parameters of a domain for RTDS scheduler Chong Li
@ 2015-06-05 11:23 ` Ian Campbell
0 siblings, 0 replies; 2+ messages in thread
From: Ian Campbell @ 2015-06-05 11:23 UTC (permalink / raw)
To: Chong Li
Cc: Chong Li, wei.liu2, Sisu Xi, george.dunlap, dario.faggioli,
xen-devel, mengxu, dgolomb
On Mon, 2015-05-25 at 19:07 -0500, Chong Li wrote:
> Add xc_sched_rtds_vcpu_get/set functions to interact with Xen to get/set a domain's
> per-VCPU parameters.
>
> 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>
It looks like there is still some discussion around the shape of the
underlying hypercall interface.
I think this is an ok wrapping of the interface as it is n the previous
patch, so if that goes ahead:
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Obviously if this needs to change due to changes in the underlying
interface then this won't apply.
One nit below.
> ---
> tools/libxc/include/xenctrl.h | 9 ++++++++
> tools/libxc/xc_rt.c | 53 +++++++++++++++++++++++++++++++++++++++++++
> 2 files changed, 62 insertions(+)
>
> diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h
> index 6994c51..45cbf91 100644
> --- a/tools/libxc/include/xenctrl.h
> +++ b/tools/libxc/include/xenctrl.h
> @@ -892,6 +892,15 @@ int xc_sched_rtds_domain_get(xc_interface *xch,
> uint32_t domid,
> struct xen_domctl_sched_rtds *sdom);
>
> +int xc_sched_rtds_vcpu_set(xc_interface *xch,
> + uint32_t domid,
> + struct xen_domctl_sched_rtds_params *sdom,
> + uint16_t num_vcpus);
> +int xc_sched_rtds_vcpu_get(xc_interface *xch,
> + uint32_t domid,
> + struct xen_domctl_sched_rtds_params *sdom,
> + uint16_t num_vcpus);
> +
> int
> xc_sched_arinc653_schedule_set(
> xc_interface *xch,
> diff --git a/tools/libxc/xc_rt.c b/tools/libxc/xc_rt.c
> index b2d1cc5..42aea22 100644
> --- a/tools/libxc/xc_rt.c
> +++ b/tools/libxc/xc_rt.c
> @@ -63,3 +63,56 @@ int xc_sched_rtds_domain_get(xc_interface *xch,
>
> return rc;
> }
> +
> +int xc_sched_rtds_vcpu_set(xc_interface *xch,
> + uint32_t domid,
> + struct xen_domctl_sched_rtds_params *sdom,
> + uint16_t num_vcpus)
> +{
> + int rc;
> + DECLARE_DOMCTL;
> + DECLARE_HYPERCALL_BOUNCE(sdom, sizeof(*sdom) * num_vcpus,
> + XC_HYPERCALL_BUFFER_BOUNCE_IN);
Blank line here please.
> + if ( xc_hypercall_bounce_pre(xch, sdom) )
> + return -1;
> +
> + domctl.cmd = XEN_DOMCTL_scheduler_vcpu_op;
> + domctl.domain = (domid_t) domid;
> + domctl.u.scheduler_vcpu_op.sched_id = XEN_SCHEDULER_RTDS;
> + domctl.u.scheduler_vcpu_op.cmd = XEN_DOMCTL_SCHEDOP_putvcpuinfo;
> + domctl.u.scheduler_vcpu_op.u.rtds.nr_vcpus = num_vcpus;
> + set_xen_guest_handle(domctl.u.scheduler_vcpu_op.u.rtds.vcpus, sdom);
> +
> + rc = do_domctl(xch, &domctl);
> +
> + xc_hypercall_bounce_post(xch, sdom);
> +
> + return rc;
> +}
> +
> +int xc_sched_rtds_vcpu_get(xc_interface *xch,
> + uint32_t domid,
> + struct xen_domctl_sched_rtds_params *sdom,
> + uint16_t num_vcpus)
> +{
> + int rc;
> + DECLARE_DOMCTL;
> + DECLARE_HYPERCALL_BOUNCE(sdom, sizeof(*sdom) * num_vcpus,
> + XC_HYPERCALL_BUFFER_BOUNCE_OUT);
> +
> + if ( xc_hypercall_bounce_pre(xch, sdom) )
> + return -1;
> +
> + domctl.cmd = XEN_DOMCTL_scheduler_vcpu_op;
> + domctl.domain = (domid_t) domid;
> + domctl.u.scheduler_vcpu_op.sched_id = XEN_SCHEDULER_RTDS;
> + domctl.u.scheduler_vcpu_op.cmd = XEN_DOMCTL_SCHEDOP_getvcpuinfo;
> + domctl.u.scheduler_vcpu_op.u.rtds.nr_vcpus=num_vcpus;
> + set_xen_guest_handle(domctl.u.scheduler_vcpu_op.u.rtds.vcpus, sdom);
> +
> + rc = do_domctl(xch, &domctl);
> +
> + xc_hypercall_bounce_post(xch, sdom);
> +
> + return rc;
> +}
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-06-05 11:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-26 0:07 [PATCH v2 for Xen 4.6 2/4] libxc: enabling XL to set per-VCPU parameters of a domain for RTDS scheduler Chong Li
2015-06-05 11:23 ` Ian Campbell
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.