Enable per-VCPU parameter for RTDS
v9 cover Enable per-VCPU parameter for RTDS
[Goal]
The current xl sched-rtds tool can only set the VCPUs of a domain to the same parameter although the scheduler supports VCPUs with different parameters. This patchset is to enable xl sched-rtds tool to configure the VCPUs of a domain with different parameters.
This per-VCPU settings can be used in many scenarios. For example, based on Dario's statement in our pervious discussion
(http://lists.xen.org/archives/html/xen-devel/2014-09/msg00423.html),
if there are two real-time applications, which have different timing requirements, running in a multi-VCPU guest domain, it is beneficial to pin these two applications to two seperate VCPUs with different scheduling parameters.
What this patchset includes is a wanted and planned feature for RTDS scheudler(http://wiki.xenproject.org/wiki/RTDS-Based-Scheduler) in Xen 4.7. The interface design of the xl sched-rtds tool is based on Meng's previous discussion with Dario, George and Wei
(http://lists.xen.org/archives/html/xen-devel/2015-02/msg02606.html).
Basically, there are two main changes:
1) in xl, we create an array that records all VCPUs whose parameters are about to modify or output.
2) in libxl, we receive the array and call different xc functions to handle it.
3) in xen and libxc, we use XEN_DOMCTL_SCHEDOP_getvcpuinfo/putvcpuinfo(introduced by this patchset) as the hypercall for per-VCPU operations(get/set method).
[Usage]
With this patchset in use, xl sched-rtds tool can:
1) show the budget and period of each VCPU of each domain, by using "xl sched-rtds -v all" command. An example would be like:
# xl sched-rtds -v all Cpupool Pool-0: sched=RTDS Name ID VCPU Period Budget Domain-0 0 0 10000 4000 vm1 1 0 300 150 vm1 1 1 400 200 vm1 1 2 10000 4000 vm1 1 3 1000 500 vm2 2 0 10000 4000 vm2 2 1 10000 4000
Using "xl sched-rtds" will output the default scheduling parameters for each domain. An example would be like:
# xl sched-rtds Cpupool Pool-0: sched=RTDS Name ID Period Budget Domain-0 0 10000 4000 vm1 1 10000 4000 vm2 2 10000 4000
2) show the budget and period of each VCPU of a specific domain, by using, e.g., "xl sched-rtds -d vm1 -v all" command. The output would be like:
# xl sched-rtds -d vm1 -v all Name ID VCPU Period Budget vm1 1 0 300 150 vm1 1 1 400 200 vm1 1 2 10000 4000 vm1 1 3 1000 500
To show a subset of the parameters of the VCPUs of a specific domain, please use, e.g.,"xl sched-rtds -d vm1 -v 0 -v 3" command. The output would be:
# xl sched-rtds -d vm1 -v 0 -v 3 Name ID VCPU Period Budget vm1 1 0 300 150 vm1 1 3 1000 500
Using command, e.g., "xl sched-rtds -d vm1" will output the default scheduling parameters of vm1. An example would be like:
# xl sched-rtds -d vm1 Name ID Period Budget vm1 1 10000 4000
3) Users can set the budget and period of multiple VCPUs of a specific domain with only one command,
e.g., "xl sched-rtds -d vm1 -v 0 -p 100 -b 50 -v 3 -p 300 -b 150".
Users can set all VCPUs with the same parameters, by one command. e.g., "xl sched-rtds -d vm1 -v all -p 500 -b 250".
The github repo for this patch is at:
https://github.com/Chong-Li/xen.git
And the branch name is:
vcpu-rtds
(https://github.com/Chong-Li/xen/tree/vcpu-rtds)
---
Chong Li (4):
xen: enable per-VCPU parameter for RTDS
libxc: enable per-VCPU parameter for RTDS
libxl: enable per-VCPU parameter for RTDS
xl: enable per-VCPU parameter for RTDS
docs/man/xl.pod.1 | 67 ++++++++ tools/libxc/include/xenctrl.h | 8 + tools/libxc/xc_rt.c | 68 ++++++++ tools/libxl/libxl.c | 386 +++++++++++++++++++++++++++++++++++++++--- tools/libxl/libxl.h | 41 +++++ tools/libxl/libxl_types.idl | 14 ++ tools/libxl/xl_cmdimpl.c | 365 +++++++++++++++++++++++++++++++++++---- tools/libxl/xl_cmdtable.c | 4 +- xen/common/sched_credit.c | 14 +- xen/common/sched_credit2.c | 13 +- xen/common/sched_rt.c | 93 ++++++++-- xen/common/schedule.c | 15 +- xen/include/public/domctl.h | 63 +++++-- 13 files changed, 1052 insertions(+), 99 deletions(-)
Signature · 7 lines
1.9.1 _______________________________________________ Xen-devel mailing list [email protected] http://lists.xen.org/xen-devel
PATCH v9 1/4 xen: enable per-VCPU parameter for RTDS
Add XEN_DOMCTL_SCHEDOP_getvcpuinfo and _putvcpuinfo hypercalls to independently get and set the scheduling parameters of each vCPU of a domain.
Also fix a bug in XEN_DOMCTL_SCHEDOP_getinfo, where PERIOD and BUDGET are not divided by MICROSECS(1) before being retruned to the caller.
---
Changes on PATCH v8:
1) Move BUG fix description before SoB.
2) Remove the unuseful padding in struct xen_domctl_schedparam_vcpu.
Changes on PATCH v7:
1) A bug in case XEN_DOMCTL_SCHEDOP_getinfo (in Xen 4.6) is fixed:
The default PERIOD or BUDGET should be divided by MICROSECS(1), before returned to upper caller.
2) In the *cntl() functions in sched_credit.c and sched_credit2.c, remove two unhandled cases in "switch".
Changes on PATCH v6:
1) Add explain for nr_vcpus in struct xen_domctl_scheduler_op, because it is used in both IN and OUT ways.
2) Remove the check and warning for vcpu settings with low budget or budget. Making this feature "per-domain" or "per-operation" is one of the future work.
3) In the *cntl() functions in sched_credit.c and sched_credit2.c, change the "if-else" structure to "switch" structure.
4) In rt_dom_cntl(), use copy_to_guest* instead of __copy_to_guest*, because the latter one requires lock protection.
Changes on PATCH v5:
1) When processing XEN_DOMCTL_SCHEDOP_get/putvcpuinfo, we do preemption check in a similar way to XEN_SYSCTL_pcitopoinfo
Changes on PATCH v4:
1) Add uint32_t vcpu_index to struct xen_domctl_scheduler_op. When processing XEN_DOMCTL_SCHEDOP_get/putvcpuinfo, we call hypercall_preemption_check in case the current hypercall lasts too long. If we decide to preempt the current hypercall, we record the index of the most-recent finished vcpu into the vcpu_index of struct xen_domctl_scheduler_op. So when we resume the hypercall after preemption, we start processing from the posion specified by vcpu_index, and don't need to repeat the work that has already been done in the hypercall before the preemption.
(This design is based on the do_grant_table_op() in grant_table.c)
2) Coding style changes
Changes on PATCH v3:
1) Remove struct xen_domctl_schedparam_t.
2) Change struct xen_domctl_scheduler_op.
3) Check if period/budget is within a validated range
Changes on PATCH v2:
1) Change struct xen_domctl_scheduler_op, for transferring per-vcpu parameters between libxc and hypervisor.
2) Handler of XEN_DOMCTL_SCHEDOP_getinfo now just returns the default budget and period values of RTDS scheduler.
3) Handler of XEN_DOMCTL_SCHEDOP_getvcpuinfo now can return a random subset of the parameters of the VCPUs of a specific domain
--- xen/common/sched_credit.c | 14 +++---- xen/common/sched_credit2.c | 13 ++++--- xen/common/sched_rt.c | 93 ++++++++++++++++++++++++++++++++++++++------- xen/common/schedule.c | 15 ++++++-- xen/include/public/domctl.h | 63 ++++++++++++++++++++++++------ 5 files changed, 156 insertions(+), 42 deletions(-)
xen/common/sched_credit.c +7 -7
@@ -1080,15 +1080,13 @@ csched_dom_cntl(* lock. Runq lock not needed anywhere in here. */ spin_lock_irqsave (&prv->lock, flags); -if ( op->cmd == XEN_DOMCTL_SCHEDOP_getinfo ) +switch ( op->cmd ) { +case XEN_DOMCTL_SCHEDOP_getinfo: op->u.credit.weight = sdom->weight; op->u.credit.cap = sdom->cap; - } -else - { -ASSERT (op->cmd == XEN_DOMCTL_SCHEDOP_putinfo); - +break ; +case XEN_DOMCTL_SCHEDOP_putinfo:if ( op->u.credit.weight !=0 ) {if ( !list_empty (&sdom->active_sdom_elem) )
@@ -1101,7 +1099,9 @@ csched_dom_cntl(if ( op->u.credit.cap != (uint16_t )~0U ) sdom->cap = op->u.credit.cap; - +break ; +default : +return -EINVAL ; }spin_unlock_irqrestore (&prv->lock, flags);
xen/common/sched_credit2.c +7 -6
@@ -1421,14 +1421,12 @@ csched2_dom_cntl(* runq lock to update csvcs. */ spin_lock_irqsave (&prv->lock, flags); -if ( op->cmd == XEN_DOMCTL_SCHEDOP_getinfo ) +switch ( op->cmd ) { +case XEN_DOMCTL_SCHEDOP_getinfo: op->u.credit2.weight = sdom->weight; - } -else - { -ASSERT (op->cmd == XEN_DOMCTL_SCHEDOP_putinfo); - +break ; +case XEN_DOMCTL_SCHEDOP_putinfo:if ( op->u.credit2.weight !=0 ) {struct vcpu *v;
@@ -1457,6 +1455,9 @@ csched2_dom_cntl(vcpu_schedule_unlock (lock, svc->vcpu); } } +break ; +default : +return -EINVAL ; }spin_unlock_irqrestore (&prv->lock, flags);
xen/common/sched_rt.c +79 -14
115 lines not on this page · raw message
xen/common/schedule.c +12 -3
@@ -1235,11 +1235,20 @@ long sched_adjust(struct domain *d, struct xen_domctl_scheduler_op *op)if ( ret )return ret; -if ( (op->sched_id !=DOM2OP (d)->sched_id) || - ((op->cmd != XEN_DOMCTL_SCHEDOP_putinfo) && - (op->cmd != XEN_DOMCTL_SCHEDOP_getinfo)) ) +if ( op->sched_id !=DOM2OP (d)->sched_id )return -EINVAL ; +switch ( op->cmd ) + { +case XEN_DOMCTL_SCHEDOP_putinfo: +case XEN_DOMCTL_SCHEDOP_getinfo: +case XEN_DOMCTL_SCHEDOP_putvcpuinfo: +case XEN_DOMCTL_SCHEDOP_getvcpuinfo: +break ; +default : +return -EINVAL ; + } +/* NB: the pluggable scheduler code needs to take care * of locking by itself. */ if ( (ret =SCHED_OP (DOM2OP (d), adjust, d, op)) ==0 )
xen/include/public/domctl.h +51 -12
75 lines not on this page · raw message
Signature · 7 lines
1.9.1 _______________________________________________ Xen-devel mailing list [email protected] http://lists.xen.org/xen-devel
PATCH v9 2/4 libxc: enable per-VCPU parameter for RTDS
In reply to Chong LiAdd xc_sched_rtds_vcpu_get/set functions to interact with Xen to get/set a domain's per-VCPU parameters.
---
Changes on PATCH v7:
1) rc in xc_sched_rtds_vcpu_set() should not be initialized to 0. It is fixed.
Changes on PATCH v6:
1) Resolve some coding sytle issues
Changes on PATCH v5:
1) In xc_sched_rtds_vcpu_get/set, re-issueing the hypercall if it is preempted.
Changes on PATCH v4:
1) Minor modifications on the function parameters.
Changes on PATCH v2:
1) Minor modifications due to the change of struct xen_domctl_scheduler_op.
--- tools/libxc/include/xenctrl.h | 8 +++++ tools/libxc/xc_rt.c | 68 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 76 insertions(+)
tools/libxc/include/xenctrl.h +8 -0
@@ -878,6 +878,14 @@ int xc_sched_rtds_domain_set(xc_interface *xch,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_schedparam_vcpu *vcpus, +uint32_t num_vcpus); +int xc_sched_rtds_vcpu_get (xc_interface *xch, +uint32_t domid, +struct xen_domctl_schedparam_vcpu *vcpus, +uint32_t num_vcpus);int xc_sched_arinc653_schedule_set(
tools/libxc/xc_rt.c +68 -0
71 lines not on this page · raw message
Signature · 7 lines
1.9.1 _______________________________________________ Xen-devel mailing list [email protected] http://lists.xen.org/xen-devel
PATCH v9 3/4 libxl: enable per-VCPU parameter for RTDS
In reply to Chong LiAdd libxl_vcpu_sched_params_get/set and sched_rtds_vcpu_get/set functions to support per-VCPU settings.
---
Changes on PATCH v8:
1) Add libxl_vcpu_sched_params_get_all() and sched_rtds_vcpu_get_all() to output all vcpus of a domain.
Changes on PATCH v7:
1) Fix a mistake in sched_rtds_domain_set()
Changes on PATCH v6:
1) Resolve some coding style issues
2) Change sched_rtds_validate_params()
3) Small changes for sched_rtds_vcpus_params_set(all) functions
Changes on PATCH v5:
1) Add a seperate function, sched_rtds_vcpus_params_set_all(), to set the parameters of all vcpus of a domain.
2) Add libxl_vcpu_sched_params_set_all() to invoke the above function.
3) Coding style changes. (I didn't find the indentation rules for function calls with long parameters (still 4 spaces?), so I just imitated the indentation style of some existing functions)
Changes on PATCH v4:
1) Coding style changes
Changes on PATCH v3:
1) Add sanity check on vcpuid
2) Add comments on per-domain and per-vcpu functions for libxl users
Changes on PATCH v2:
1) New data structure (libxl_vcpu_sched_params and libxl_sched_params) to help per-VCPU settings.
2) sched_rtds_vcpu_get now can return a random subset of the parameters of the VCPUs of a specific domain.
--- tools/libxl/libxl.c | 386 +++++++++++++++++++++++++++++++++++++++++--- tools/libxl/libxl.h | 41 +++++ tools/libxl/libxl_types.idl | 14 ++ 3 files changed, 420 insertions(+), 21 deletions(-)
tools/libxl/libxl.c +365 -21
@@ -5779,6 +5779,236 @@ static int sched_credit2_domain_set(libxl__gc *gc, uint32_t domid,return 0 ; } +static int sched_rtds_validate_params (libxl__gc *gc,int period,int budget) +{ +int rc; + +if (period <1 ) { +LOG (ERROR ,"Invalid VCPU period of %d (it should be >= 1)" , period); + rc =ERROR_INVAL ; + goto out; + } + +if (budget <1 ) { +LOG (ERROR ,"Invalid VCPU budget of %d (it should be >= 1)" , budget); + rc =ERROR_INVAL ; + goto out; + } + +if (budget > period) { +LOG (ERROR ,"VCPU budget must be smaller than or equal to period, " +"but %d > %d" , budget, period); + rc =ERROR_INVAL ; + goto out; + } + rc =0 ; +out: +return rc; +} + +/* Get the RTDS scheduling parameters of vcpu(s) */ +static int sched_rtds_vcpu_get (libxl__gc *gc,uint32_t domid, +libxl_vcpu_sched_params *scinfo) +{ +uint32_t num_vcpus; +int i, r, rc; +xc_dominfo_t info; +struct xen_domctl_schedparam_vcpu *vcpus; + + r =xc_domain_getinfo (CTX ->xch, domid,1 , &info); +if (r <0 ) { +LOGE (ERROR ,"getting domain info" ); + rc =ERROR_FAIL ; + goto out; + } + +if (scinfo->num_vcpus <=0 ) { + rc =ERROR_INVAL ; + goto out; + }else { + num_vcpus = scinfo->num_vcpus; +GCNEW_ARRAY (vcpus, num_vcpus); +for (i =0 ; i < num_vcpus; i++) { +if (scinfo->vcpus[i].vcpuid <0 || + scinfo->vcpus[i].vcpuid > info.max_vcpu_id) { +LOG (ERROR ,"VCPU index is out of range, " +"valid values are within range from 0 to %d" , + info.max_vcpu_id); + rc =ERROR_INVAL ; + goto out; + } + vcpus[i].vcpuid = scinfo->vcpus[i].vcpuid; + } + } + + r =xc_sched_rtds_vcpu_get (CTX ->xch, domid, vcpus, num_vcpus); +if (r !=0 ) { +LOGE (ERROR ,"getting vcpu sched rtds" ); + rc =ERROR_FAIL ; + goto out; + } + scinfo->sched =LIBXL_SCHEDULER_RTDS ; +for (i =0 ; i < num_vcpus; i++) { + scinfo->vcpus[i].period = vcpus[i].u.rtds.period; + scinfo->vcpus[i].budget = vcpus[i].u.rtds.budget; + scinfo->vcpus[i].vcpuid = vcpus[i].vcpuid; + } + rc =0 ; +out: +return rc; +} + +/* Get the RTDS scheduling parameters of all vcpus of a domain */ +static int sched_rtds_vcpu_get_all (libxl__gc *gc,uint32_t domid, +libxl_vcpu_sched_params *scinfo) +{ +uint32_t num_vcpus; +int i, r, rc; +xc_dominfo_t info; +struct xen_domctl_schedparam_vcpu *vcpus; + + r =xc_domain_getinfo (CTX ->xch, domid,1 , &info); +if (r <0 ) { +LOGE (ERROR ,"getting domain info" ); + rc =ERROR_FAIL ; + goto out; + } + +if (scinfo->num_vcpus >0 ) { + rc =ERROR_INVAL ; + goto out; + }else { + num_vcpus = info.max_vcpu_id +1 ; +GCNEW_ARRAY (vcpus, num_vcpus); +for (i =0 ; i < num_vcpus; i++) + vcpus[i].vcpuid = i; + } + + r =xc_sched_rtds_vcpu_get (CTX ->xch, domid, vcpus, num_vcpus); +if (r !=0 ) { +LOGE (ERROR ,"getting vcpu sched rtds" ); + rc =ERROR_FAIL ; + goto out; + } + scinfo->sched =LIBXL_SCHEDULER_RTDS ; + scinfo->num_vcpus = num_vcpus; + scinfo->vcpus =libxl__calloc (NOGC , num_vcpus, +sizeof (libxl_sched_params)); + +for (i =0 ; i < num_vcpus; i++) { + scinfo->vcpus[i].period = vcpus[i].u.rtds.period; + scinfo->vcpus[i].budget = vcpus[i].u.rtds.budget; + scinfo->vcpus[i].vcpuid = vcpus[i].vcpuid; + } + rc =0 ; +out: +return rc; +} + +/* Set the RTDS scheduling parameters of vcpu(s) */ +static int sched_rtds_vcpu_set (libxl__gc *gc,uint32_t domid, +const libxl_vcpu_sched_params *scinfo) +{ +int r, rc; +int i; +uint16_t max_vcpuid; +xc_dominfo_t info; +struct xen_domctl_schedparam_vcpu *vcpus; + + r =xc_domain_getinfo (CTX ->xch, domid,1 , &info); +if (r <0 ) { +LOGE (ERROR ,"getting domain info" ); + rc =ERROR_FAIL ; + goto out; + } + max_vcpuid = info.max_vcpu_id; + +if (scinfo->num_vcpus <=0 ) { + rc =ERROR_INVAL ; + goto out; + } +for (i =0 ; i < scinfo->num_vcpus; i++) { +if (scinfo->vcpus[i].vcpuid <0 || + scinfo->vcpus[i].vcpuid > max_vcpuid) { +LOG (ERROR ,"Invalid VCPU %d: valid range is [0, %d]" , + scinfo->vcpus[i].vcpuid, max_vcpuid); + rc =ERROR_INVAL ; + goto out; + } + rc =sched_rtds_validate_params (gc, scinfo->vcpus[i].period, + scinfo->vcpus[i].budget); +if (rc) { + rc =ERROR_INVAL ; + goto out; + } + } +GCNEW_ARRAY (vcpus, scinfo->num_vcpus); +for (i =0 ; i < scinfo->num_vcpus; i++) { + vcpus[i].vcpuid = scinfo->vcpus[i].vcpuid; + vcpus[i].u.rtds.period = scinfo->vcpus[i].period; + vcpus[i].u.rtds.budget = scinfo->vcpus[i].budget; + } + + r =xc_sched_rtds_vcpu_set (CTX ->xch, domid, + vcpus, scinfo->num_vcpus); +if (r !=0 ) { +LOGE (ERROR ,"setting vcpu sched rtds" ); + rc =ERROR_FAIL ; + goto out; + } + rc =0 ; +out: +return rc; +} + +/* Set the RTDS scheduling parameters of all vcpus of a domain */ +static int sched_rtds_vcpu_set_all (libxl__gc *gc,uint32_t domid, +const libxl_vcpu_sched_params *scinfo) +{ +int r, rc; +int i; +uint16_t max_vcpuid; +xc_dominfo_t info; +struct xen_domctl_schedparam_vcpu *vcpus; +uint32_t num_vcpus; + + r =xc_domain_getinfo (CTX ->xch, domid,1 , &info); +if (r <0 ) { +LOGE (ERROR ,"getting domain info" ); + rc =ERROR_FAIL ; + goto out; + } + max_vcpuid = info.max_vcpu_id; + +if (scinfo->num_vcpus !=1 ) { + rc =ERROR_INVAL ; + goto out; + } +if (sched_rtds_validate_params (gc, scinfo->vcpus[0 ].period, + scinfo->vcpus[0 ].budget)) { + rc =ERROR_INVAL ; + goto out; + } + num_vcpus = max_vcpuid +1 ; +GCNEW_ARRAY (vcpus, num_vcpus); +for (i =0 ; i < num_vcpus; i++) { + vcpus[i].vcpuid = i; + vcpus[i].u.rtds.period = scinfo->vcpus[0 ].period; + vcpus[i].u.rtds.budget = scinfo->vcpus[0 ].budget; + } + + r =xc_sched_rtds_vcpu_set (CTX ->xch, domid, + vcpus, num_vcpus); +if (r !=0 ) { +LOGE (ERROR ,"setting vcpu sched rtds" ); + rc =ERROR_FAIL ; + goto out; + } + rc =0 ; +out: +return rc; +} +static int sched_rtds_domain_get (libxl__gc *gc,uint32_t domid,libxl_domain_sched_params *scinfo) {
@@ -5811,30 +6041,12 @@ static int sched_rtds_domain_set(libxl__gc *gc, uint32_t domid,LOGE (ERROR ,"getting domain sched rtds" );return ERROR_FAIL ; } - -if (scinfo->period !=LIBXL_DOMAIN_SCHED_PARAM_PERIOD_DEFAULT ) { -if (scinfo->period <1 ) { -LOG (ERROR ,"VCPU period is not set or out of range, " -"valid values are larger than 1" ); -return ERROR_INVAL ; - } +if (scinfo->period !=LIBXL_DOMAIN_SCHED_PARAM_PERIOD_DEFAULT ) sdom.period = scinfo->period; - } - -if (scinfo->budget !=LIBXL_DOMAIN_SCHED_PARAM_BUDGET_DEFAULT ) { -if (scinfo->budget <1 ) { -LOG (ERROR ,"VCPU budget is not set or out of range, " -"valid values are larger than 1" ); -return ERROR_INVAL ; - } +if (scinfo->budget !=LIBXL_DOMAIN_SCHED_PARAM_BUDGET_DEFAULT ) sdom.budget = scinfo->budget; - } - -if (sdom.budget > sdom.period) { -LOG (ERROR ,"VCPU budget is larger than VCPU period, " -"VCPU budget should be no larger than VCPU period" ); +if (sched_rtds_validate_params (gc, sdom.period, sdom.budget))return ERROR_INVAL ; - } rc =xc_sched_rtds_domain_set (CTX ->xch, domid, &sdom);if (rc <0 ) {
@@ -5882,6 +6094,74 @@ int libxl_domain_sched_params_set(libxl_ctx *ctx, uint32_t domid,return ret; } +int libxl_vcpu_sched_params_set (libxl_ctx *ctx,uint32_t domid, +const libxl_vcpu_sched_params *scinfo) +{ +GC_INIT (ctx); +libxl_scheduler sched = scinfo->sched; +int rc; + +if (sched ==LIBXL_SCHEDULER_UNKNOWN ) + sched =libxl__domain_scheduler (gc, domid); + +switch (sched) { +case LIBXL_SCHEDULER_SEDF : +LOG (ERROR ,"SEDF scheduler no longer available" ); + rc =ERROR_FEATURE_REMOVED ; +break ; +case LIBXL_SCHEDULER_CREDIT : +case LIBXL_SCHEDULER_CREDIT2 : +case LIBXL_SCHEDULER_ARINC653 : +LOG (ERROR ,"per-VCPU parameter setting not supported for this scheduler" ); + rc =ERROR_INVAL ; +break ; +case LIBXL_SCHEDULER_RTDS : + rc =sched_rtds_vcpu_set (gc, domid, scinfo); +break ; +default : +LOG (ERROR ,"Unknown scheduler" ); + rc =ERROR_INVAL ; +break ; + } + +GC_FREE ; +return rc; +} + +int libxl_vcpu_sched_params_set_all (libxl_ctx *ctx,uint32_t domid, +const libxl_vcpu_sched_params *scinfo) +{ +GC_INIT (ctx); +libxl_scheduler sched = scinfo->sched; +int rc; + +if (sched ==LIBXL_SCHEDULER_UNKNOWN ) + sched =libxl__domain_scheduler (gc, domid); + +switch (sched) { +case LIBXL_SCHEDULER_SEDF : +LOG (ERROR ,"SEDF scheduler no longer available" ); + rc =ERROR_FEATURE_REMOVED ; +break ; +case LIBXL_SCHEDULER_CREDIT : +case LIBXL_SCHEDULER_CREDIT2 : +case LIBXL_SCHEDULER_ARINC653 : +LOG (ERROR ,"per-VCPU parameter setting not supported for this scheduler" ); + rc =ERROR_INVAL ; +break ; +case LIBXL_SCHEDULER_RTDS : + rc =sched_rtds_vcpu_set_all (gc, domid, scinfo); +break ; +default : +LOG (ERROR ,"Unknown scheduler" ); + rc =ERROR_INVAL ; +break ; + } + +GC_FREE ; +return rc; +} +int libxl_domain_sched_params_get (libxl_ctx *ctx,uint32_t domid,libxl_domain_sched_params *scinfo) {
@@ -5916,6 +6196,70 @@ int libxl_domain_sched_params_get(libxl_ctx *ctx, uint32_t domid,return ret; } +int libxl_vcpu_sched_params_get (libxl_ctx *ctx,uint32_t domid, +libxl_vcpu_sched_params *scinfo) +{ +GC_INIT (ctx); +int rc; + + scinfo->sched =libxl__domain_scheduler (gc, domid); + +switch (scinfo->sched) { +case LIBXL_SCHEDULER_SEDF : +LOG (ERROR ,"SEDF scheduler is no longer available" ); + rc =ERROR_FEATURE_REMOVED ; +break ; +case LIBXL_SCHEDULER_CREDIT : +case LIBXL_SCHEDULER_CREDIT2 : +case LIBXL_SCHEDULER_ARINC653 : +LOG (ERROR ,"per-VCPU parameter getting not supported for this scheduler" ); + rc =ERROR_INVAL ; +break ; +case LIBXL_SCHEDULER_RTDS : + rc =sched_rtds_vcpu_get (gc, domid, scinfo); +break ; +default : +LOG (ERROR ,"Unknown scheduler" ); + rc =ERROR_INVAL ; +break ; + } + +GC_FREE ; +return rc; +} + +int libxl_vcpu_sched_params_get_all (libxl_ctx *ctx,uint32_t domid, +libxl_vcpu_sched_params *scinfo) +{ +GC_INIT (ctx); +int rc; + + scinfo->sched =libxl__domain_scheduler (gc, domid); + +switch (scinfo->sched) { +case LIBXL_SCHEDULER_SEDF : +LOG (ERROR ,"SEDF scheduler is no longer available" ); + rc =ERROR_FEATURE_REMOVED ; +break ; +case LIBXL_SCHEDULER_CREDIT : +case LIBXL_SCHEDULER_CREDIT2 : +case LIBXL_SCHEDULER_ARINC653 : +LOG (ERROR ,"per-VCPU parameter getting not supported for this scheduler" ); + rc =ERROR_INVAL ; +break ; +case LIBXL_SCHEDULER_RTDS : + rc =sched_rtds_vcpu_get_all (gc, domid, scinfo); +break ; +default : +LOG (ERROR ,"Unknown scheduler" ); + rc =ERROR_INVAL ; +break ; + } + +GC_FREE ; +return rc; +} +static int libxl__domain_s3_resume (libxl__gc *gc,int domid) {int rc =0 ;
tools/libxl/libxl.h +41 -0
58 lines not on this page · raw message
tools/libxl/libxl_types.idl +14 -0
@@ -387,6 +387,20 @@ libxl_domain_restore_params = Struct("domain_restore_params", [ ("stream_version", uint32, {'init_val': '1'}), ]) +libxl_sched_params = Struct("sched_params",[ + ("vcpuid", integer, {'init_val': 'LIBXL_SCHED_PARAM_VCPU_INDEX_DEFAULT'}), + ("weight", integer, {'init_val': 'LIBXL_DOMAIN_SCHED_PARAM_WEIGHT_DEFAULT'}), + ("cap", integer, {'init_val': 'LIBXL_DOMAIN_SCHED_PARAM_CAP_DEFAULT'}), + ("period", integer, {'init_val': 'LIBXL_DOMAIN_SCHED_PARAM_PERIOD_DEFAULT'}), + ("extratime", integer, {'init_val': 'LIBXL_DOMAIN_SCHED_PARAM_EXTRATIME_DEFAULT'}), + ("budget", integer, {'init_val': 'LIBXL_DOMAIN_SCHED_PARAM_BUDGET_DEFAULT'}), + ]) + +libxl_vcpu_sched_params = Struct("vcpu_sched_params",[ + ("sched", libxl_scheduler), + ("vcpus", Array(libxl_sched_params, "num_vcpus")), + ]) + libxl_domain_sched_params = Struct("domain_sched_params",[ ("sched", libxl_scheduler), ("weight", integer, {'init_val': 'LIBXL_DOMAIN_SCHED_PARAM_WEIGHT_DEFAULT'}),
Signature · 7 lines
1.9.1 _______________________________________________ Xen-devel mailing list [email protected] http://lists.xen.org/xen-devel
PATCH v9 4/4 xl: enable per-VCPU parameter for RTDS
In reply to Chong LiChange main_sched_rtds and related output functions to support per-VCPU settings.
---
Changes on PATCH v8:
1) Improve the example in xl.pod.1
2) Add sched_rtds_vcpu_output_all() and sched_vcpu_get_all() to output all vcpus of a domain
3) Fix some coding style issues
Changes on PATCH v7:
1) Add example to xl.pod.1
Changes on PATCH v6:
1) More explain in xl.pod.1 and cmdtable.c
2) Resolve some coding sytle issues
Changes on PATCH v5:
1) Add sched_vcpu_set_all() for the cases that all vcpus of a domain need to be changed together.
Changes on PATCH v4:
1) Coding style changes
Changes on PATCH v3:
1) Support commands, e.g., "xl sched-rtds -d vm1" to output the default scheduling parameters
Changes on PATCH v2:
1) Remove per-domain output functions for RTDS scheduler.
2) Users now use '-v all' to specify all VCPUs.
3) Support outputting a subset of the parameters of the VCPUs of a specific domain.
4) When setting all VCPUs with the same parameters (by only one command), no per-domain function is invoked.
--- docs/man/xl.pod.1 | 67 +++++++++ tools/libxl/xl_cmdimpl.c | 365 +++++++++++++++++++++++++++++++++++++++++----- tools/libxl/xl_cmdtable.c | 4 +- 3 files changed, 400 insertions(+), 36 deletions(-)
docs/man/xl.pod.1 +67 -0
@@ -1056,6 +1056,10 @@ B<OPTIONS> Specify domain for which scheduler parameters are to be modified or retrieved. Mandatory for modifying scheduler parameters. +=item B<-v VCPUID/all>, B<--vcpuid=VCPUID/all> + +Specify vcpu for which scheduler parameters are to be modified or retrieved. + =item B<-p PERIOD>, B<--period=PERIOD> Period of time, in microseconds, over which to replenish the budget.
@@ -1071,6 +1075,69 @@ Restrict output to domains in the specified cpupool. =back +B<EXAMPLE> + +=over 4 + +1) Use B<-v all> to see the budget and period of all the VCPUs of +all the domains: + + xl sched-rtds -v all + Cpupool Pool-0: sched=RTDS + Name ID VCPU Period Budget + Domain-0 0 0 10000 4000 + vm1 1 0 300 150 + vm1 1 1 400 200 + vm1 1 2 10000 4000 + vm1 1 3 1000 500 + vm2 2 0 10000 4000 + vm2 2 1 10000 4000 + +Without any arguments, it will output the default scheduing +parameters for each domain: + + xl sched-rtds + Cpupool Pool-0: sched=RTDS + Name ID Period Budget + Domain-0 0 10000 4000 + vm1 1 10000 4000 + vm2 2 10000 4000 + + +2) Use, for instance B<-d vm1, -v all> to see the budget and +period of all VCPUs of a specific domain (B<vm1>): + + xl sched-rtds -d vm1 -v all + Name ID VCPU Period Budget + vm1 1 0 300 150 + vm1 1 1 400 200 + vm1 1 2 10000 4000 + vm1 1 3 1000 500 + +To see the parameters of a subset of the VCPUs of a domain, use: + + xl sched-rtds -d vm1 -v 0 -v 3 + Name ID VCPU Period Budget + vm1 1 0 300 150 + vm1 1 3 1000 500 + +If no B<-v> is speficified, the default scheduling parameter for the +domain are shown: + + xl sched-rtds -d vm1 + Name ID Period Budget + vm1 1 10000 4000 + + +3) Users can set the budget and period of multiple VCPUs of a +specific domain with only one command, +e.g., "xl sched-rtds -d vm1 -v 0 -p 100 -b 50 -v 3 -p 300 -b 150". + +To change the parameters of all the VCPUs of a domain, use B<-v all>, +e.g., "xl sched-rtds -d vm1 -v all -p 500 -b 250". + +=back + =back =head1 CPUPOOLS COMMANDS
tools/libxl/xl_cmdimpl.c +330 -35
432 lines not on this page · raw message
tools/libxl/xl_cmdtable.c +3 -1
@@ -269,8 +269,10 @@ struct cmd_spec cmd_table[] = { {"sched-rtds" , &main_sched_rtds,0 ,1 ,"Get/set rtds scheduler parameters" , -"[-d <Domain> [-p[=PERIOD]] [-b[=BUDGET]]]" , +"[-d <Domain> [-v[=VCPUID/all]] [-p[=PERIOD]] [-b[=BUDGET]]]" ,"-d DOMAIN, --domain=DOMAIN Domain to modify\n" +"-v VCPUID/all, --vcpuid=VCPUID/all VCPU to modify or output;\n" +" Using '-v all' to modify/output all vcpus\n" "-p PERIOD, --period=PERIOD Period (us)\n" "-b BUDGET, --budget=BUDGET Budget (us)\n" },
Signature · 7 lines
1.9.1 _______________________________________________ Xen-devel mailing list [email protected] http://lists.xen.org/xen-devel
Re: [PATCH v9 for Xen 4.7 1/4] xen: enable per-VCPU parameter for RTDS
In reply to Chong LiQuoted 5 lines
Quoted 1 line
Quoted 1 line · On 01.04.16 at 06:59, <[email protected]> wrote:
Add
XEN_DOMCTL_SCHEDOP_getvcpuinfoand_putvcpuinfohypercalls to independently get and set the scheduling parameters of each vCPU of a domain.
Quoted 7 lines
Also fix a bug in
XEN_DOMCTL_SCHEDOP_getinfo, where PERIOD and BUDGET are not divided by MICROSECS(1) before being retruned to the caller.Signed-off-by Chong Li <[email protected]>Signed-off-by Meng Xu <[email protected]>Signed-off-by Sisu Xi <[email protected]>
Public interface change
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Re: [PATCH v9 for Xen 4.7 1/4] xen: enable per-VCPU parameter for RTDS
In reply to Chong LiQuoted 4 lines · Chong Li
Add
XEN_DOMCTL_SCHEDOP_getvcpuinfoand_putvcpuinfohypercalls to independently get and set the scheduling parameters of each vCPU of a domain.
Quoted 8 lines
Also fix a bug in
XEN_DOMCTL_SCHEDOP_getinfo, where PERIOD and BUDGET are not divided by MICROSECS(1) before being retruned to the caller.Signed-off-by Chong Li <[email protected]>Signed-off-by Meng Xu <[email protected]>Signed-off-by Sisu Xi <[email protected]>
Thanks and Regards,
Dario
Signature · 4 lines
<<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)
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Re: [PATCH v9 for Xen 4.7 3/4] libxl: enable per-VCPU parameter for RTDS
In reply to Chong LiQuoted 10 lines · Chong Li
Add libxl_vcpu_sched_params_get/set and sched_rtds_vcpu_get/set functions to support per-VCPU settings.
Signed-off-by Chong Li <[email protected]>Signed-off-by Meng Xu <[email protected]>Signed-off-by Sisu Xi <[email protected]>Acked-by Wei Liu <[email protected]>Reviewed-by Dario Faggioli <[email protected]>
You added a new function, so you probably should have dropped the tags.
Anyway, I'll re-issue mine:
There are still things I'd like being done better. There's a certain amount of code duplication, and there still are two instances of this pattern (the 'else' is superfluous):
Quoted 10 lines
+ if (
scinfo->num_vcpus> 0) {
+ rc =ERROR_INVAL;
+ goto out;
+ } else {
+ num_vcpus = info.max_vcpu_id + 1;
+ GCNEW_ARRAY(vcpus,num_vcpus);
+ for (i = 0; i <num_vcpus; i++)
+ vcpus[i].vcpuid = i;
+ }
+
But Wei said (a few series versions ago) he is kinda fine with this, and I also don't think the series should be blocked because of it. We can improve and refactor things at a later point (adding this to my TODO list).
Thanks and Regards,
Dario
Signature · 4 lines
<<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)
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Re: [PATCH v9 for Xen 4.7 4/4] xl: enable per-VCPU parameter for RTDS
In reply to Chong LiQuoted 9 lines · Chong Li
Change
main_sched_rtdsand related output functions to support per-VCPU settings.Signed-off-by Chong Li <[email protected]>Signed-off-by Meng Xu <[email protected]>Signed-off-by Sisu Xi <[email protected]>Acked-by Wei Liu <[email protected]>
This Acked-by, I'm should have been removed. In fact, Wei sai it was subject to me saying Acked-by or Reviewed-by myself to v8. I did not say anything like that, and in fact I asked for changes, and Wei said himself that, at least some of those were necessary.
Now, you've addressed those comments, and I'm happy about how the patch is looking now, so:
But I really think Wei (or Ian) should (re-)look and (re-)Ack.
I've found only a couple of style issues. I don't feel like blocking the series or asking to resend... perhaps they can be fixed during commit? Or I'm up for sending a cleanup patch myself (which would not introduce any functional change), as soon as this hit the repo.
Here they are:
Quoted 170 lines
(quoted diff) +0
-0@@ -6554,84 +6735,198 @@ int main_sched_credit2(int argc, char **argv)
/*
* <nothing> : List all domain paramters and sched params
- * -d [domid] : List domain params for domain
+ * -d [domid] : List default domain params for domain
* -d [domid] [params] : Set domain params for domain
+ * -d [domid] -v [vcpuid 1] -v [vcpuid 2] ... :
+ * List per-VCPU params for domain
+ * -d [domid] -v all : List all per-VCPU params for domain
+ * -v all : List all per-VCPU params for all domains
+ * -d [domid] -v [vcpuid 1] [params] -v [vcpuid 2] [params] ... :
+ * Set per-VCPU params for domain
+ * -d [domid] -v all [params] : Set all per-VCPU params for domain */
intmain_sched_rtds(int argc, char **argv)
{
const char *dom = NULL;
const char *cpupool = NULL;
- int period = 0; /* period is in microsecond */
- int budget = 0; /* budget is in microsecond */
+ int *vcpus = (int *)xmalloc(sizeof(int)); /* IDs of VCPUs that change */
+ int *periods = (int *)xmalloc(sizeof(int)); /* period is in microsecond */
+ int *budgets = (int *)xmalloc(sizeof(int)); /* budget is in microsecond */
+ intv_size= 1; /* size of vcpus array */
+ intp_size= 1; /* size of periods array */
+ intb_size= 1; /* size of budgets array */
+ intv_index= 0; /* index in vcpus array */
+ intp_index=0; /* index in periods array */
+ intb_index=0; /* index for in budgets array */
boolopt_p= false;
boolopt_b= false;
- int opt, rc;
+ boolopt_v= false;
+ boolopt_all= false; /* output per-dom parameters */ + int opt, i, rc, r;
static struct option opts[] = {
{"domain", 1, 0, 'd'},
{"period", 1, 0, 'p'},
{"budget", 1, 0, 'b'},
+ {"vcpuid",1, 0, 'v'},
{"cpupool", 1, 0, 'c'},
COMMON_LONG_OPTS
};
- SWITCH_FOREACH_OPT(opt, "d:p:b:c:", opts, "sched-rtds", 0) { + SWITCH_FOREACH_OPT(opt, "d:p:b:v:c", opts, "sched-rtds", 0) { case 'd':
dom = optarg;
break;
case 'p':
- period =strtol(optarg, NULL, 10);
- opt_p = true;
+ if (p_index>=p_size) {
+ /*
+ * periods array is full
+ * double the array size for new elements
+ */
+ p_size *= 2;
+ periods =xrealloc(periods, p_size);
+ }
+ periods[p_index++] =strtol(optarg, NULL, 10);
+ opt_p = 1;
break;
case 'b':
- budget =strtol(optarg, NULL, 10);
- opt_b = true;
+ if (b_index>=b_size) { /* budgets array is full */ + b_size *= 2;
+ budgets =xrealloc(budgets, b_size);
+ }
+ budgets[b_index++] =strtol(optarg, NULL, 10);
+ opt_b = 1;
+ break;
+ case 'v':
+ if (!strcmp(optarg, "all")) { /* get or set all vcpus of a domain */
+ opt_all = 1;
+ break;
+ }
+ if (v_index>=v_size) { /* vcpus array is full */ + v_size *= 2;
+ vcpus =xrealloc(vcpus, v_size);
+ }
+ vcpus[v_index++] =strtol(optarg, NULL, 10);
+ opt_v = 1;
break;
case 'c':
cpupool = optarg;
break;
}- if (cpupool && (dom || opt_p || opt_b)) { + if (cpupool && (dom || opt_p || opt_b || opt_v || opt_all)) {fprintf(stderr, "Specifying a cpupool is not allowed with " "other options.\n");
- returnEXIT_FAILURE;
+ r =EXIT_FAILURE;
+ goto out;
}
- if (!dom && (opt_p||opt_b)) {
- fprintf(stderr, "Must specify a domain.\n");
- returnEXIT_FAILURE;
+ if (!dom && (opt_p||opt_b||opt_v)) {
+ fprintf(stderr, "Missing parameters.\n");
+ r =EXIT_FAILURE;
+ goto out;
}
- if (opt_p!=opt_b) {
- fprintf(stderr, "Must specify period and budget\n"); - returnEXIT_FAILURE;
+ if (dom && !opt_v && !opt_all && (opt_p||opt_b)) { + fprintf(stderr, "Must specify VCPU.\n");
+ r =EXIT_FAILURE;
+ goto out;
+ }
+ if (opt_v&&opt_all) {
+ fprintf(stderr, "Incorrect VCPU IDs.\n");
+ r =EXIT_FAILURE;
+ goto out;
+ }
+ if (((v_index>b_index) &&opt_b) || ((v_index>p_index) &&opt_p)
+ ||p_index!=b_index) {
+ fprintf(stderr, "Incorrect number of period and budget\n"); + r =EXIT_FAILURE;
+ goto out;
}
- if (!dom) { /* list all domain's rt scheduler info */ - if (sched_domain_output(LIBXL_SCHEDULER_RTDS,
- sched_rtds_domain_output, + if ((!dom) &&opt_all) {
+ /* get all domain's per-vcpu rtds scheduler parameters */ + rc = -sched_vcpu_output(LIBXL_SCHEDULER_RTDS,
+ sched_rtds_vcpu_output_all,sched_rtds_pool_output, - cpupool))
- returnEXIT_FAILURE;
+ cpupool);
+ if (rc) {
+ r =EXIT_FAILURE;
+ goto out;
+ }
+ } else if (!dom && !opt_all) {
+ /* list all domain's default scheduling parameters */ + rc = -sched_domain_output(LIBXL_SCHEDULER_RTDS, + sched_rtds_domain_output, + sched_rtds_pool_output, + cpupool);
+ if (rc) {
+ r =EXIT_FAILURE;
+ goto out;
+ }
} else {
uint32_t domid =find_domain(dom);
- if (!opt_p && !opt_b) { /* output rt scheduler info */ + if (!opt_v && !opt_all) { /* output default scheduling parameters */
sched_rtds_domain_output(-1);
- if (sched_rtds_domain_output(domid))
- returnEXIT_FAILURE;
- } else { /* set rt scheduler paramaters */
- libxl_domain_sched_params scinfo;
- libxl_domain_sched_params_init(&scinfo);
+ rc = -sched_rtds_domain_output(domid);
Quoted 8 lines
+ if (rc) {
+ r =EXIT_FAILURE;
+ goto out;
+ }
+ } else if (!opt_p && !opt_b) {
+ /* get per-vcpu rtds scheduling parameters */ + libxl_vcpu_sched_params scinfo;
+ libxl_vcpu_sched_params_init(&scinfo);
The variable declaration is placed properly now, but there should be a blank line between the declaration itself, and actual code.
There is another instance of this at [1].
Quoted 9 lines
+ sched_rtds_vcpu_output(-1, &scinfo);
+ scinfo.num_vcpus =v_index;
+ if (v_index> 0) {
+ scinfo.vcpus = (libxl_sched_params*)
+ xmalloc(sizeof(libxl_sched_params) * (v_index));
+ for (i = 0; i <v_index; i++)
+ scinfo.vcpus[i].vcpuid = vcpus[i];
+ rc = -sched_rtds_vcpu_output(domid, &scinfo);
Quoted 9 lines
+ } else /* get params for all vcpus */
+ rc = -sched_rtds_vcpu_output_all(domid, &scinfo); + libxl_vcpu_sched_params_dispose(&scinfo); + if (rc) {
+ r =EXIT_FAILURE;
+ goto out;
+ }
+ } else if (opt_v||opt_all) {
The indentation is wrong. There should be 4 more spaces.
Quoted 4 lines
+ /* set per-vcpu rtds scheduling parameters */ + libxl_vcpu_sched_params scinfo;
+ libxl_vcpu_sched_params_init(&scinfo);
[1].
Thanks and Regards,
Dario
Signature · 4 lines
<<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)
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Re: [PATCH v9 for Xen 4.7 3/4] libxl: enable per-VCPU parameter for RTDS
In reply to Chong LiQuoted 8 lines · Chong Li
Add libxl_vcpu_sched_params_get/set and sched_rtds_vcpu_get/set functions to support per-VCPU settings.
Signed-off-by Chong Li <[email protected]>Signed-off-by Meng Xu <[email protected]>Signed-off-by Sisu Xi <[email protected]>Acked-by Wei Liu <[email protected]>
This should have been dropped.
Quoted 6 lines
Reviewed-by Dario Faggioli <[email protected]>---
Changes on PATCH v8:
1) Addlibxl_vcpu_sched_params_get_all()andsched_rtds_vcpu_get_all()to output all vcpus of a domain.
[...]
Quoted 55 lines
tools/libxl/libxl.c +54
-0+int libxl_vcpu_sched_params_get (libxl_ctx *ctx,uint32_t domid, +libxl_vcpu_sched_params *scinfo) +{ +GC_INIT (ctx); +int rc; + + scinfo->sched =libxl__domain_scheduler (gc, domid); + +switch (scinfo->sched) { +case LIBXL_SCHEDULER_SEDF : +LOG (ERROR ,"SEDF scheduler is no longer available" ); + rc =ERROR_FEATURE_REMOVED ; +break ; +case LIBXL_SCHEDULER_CREDIT : +case LIBXL_SCHEDULER_CREDIT2 : +case LIBXL_SCHEDULER_ARINC653 : +LOG (ERROR ,"per-VCPU parameter getting not supported for this scheduler" ); + rc =ERROR_INVAL ; +break ; +case LIBXL_SCHEDULER_RTDS : + rc =sched_rtds_vcpu_get (gc, domid, scinfo); +break ; +default : +LOG (ERROR ,"Unknown scheduler" ); + rc =ERROR_INVAL ; +break ; + } + +GC_FREE ; +return rc; +} + +int libxl_vcpu_sched_params_get_all (libxl_ctx *ctx,uint32_t domid, +libxl_vcpu_sched_params *scinfo) +{ +GC_INIT (ctx); +int rc; + + scinfo->sched =libxl__domain_scheduler (gc, domid); + +switch (scinfo->sched) { +case LIBXL_SCHEDULER_SEDF : +LOG (ERROR ,"SEDF scheduler is no longer available" ); + rc =ERROR_FEATURE_REMOVED ; +break ; +case LIBXL_SCHEDULER_CREDIT : +case LIBXL_SCHEDULER_CREDIT2 : +case LIBXL_SCHEDULER_ARINC653 : +LOG (ERROR ,"per-VCPU parameter getting not supported for this scheduler" ); + rc =ERROR_INVAL ; +break ; +case LIBXL_SCHEDULER_RTDS : + rc =sched_rtds_vcpu_get_all (gc, domid, scinfo); +break ;
tools/libxl/libxl.c int libxl_domain_sched_params_get(libxl_ctx *ctx, uint32_t domid, · line 6262
Quoted 10 lines
tools/libxl/libxl.c +10
-0+default : +LOG (ERROR ,"Unknown scheduler" ); + rc =ERROR_INVAL ; +break ; + } + +GC_FREE ; +return rc; +} +
These two functions LGTM, so I shall ack this patch again:
Wei.
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Wei Liu
Acked-byRe: [PATCH v9 for Xen 4.7 4/4] xl: enable per-VCPU parameter for RTDS
In reply to Dario FaggioliQuoted 15 lines · Dario Faggioli
Quoted 9 lines · Chong Li
Change
main_sched_rtdsand related output functions to support per-VCPU settings.Signed-off-by Chong Li <[email protected]>Signed-off-by Meng Xu <[email protected]>Signed-off-by Sisu Xi <[email protected]>Acked-by Wei Liu <[email protected]>This Acked-by, I'm should have been removed. In fact, Wei sai it was subject to me saying Acked-by or Reviewed-by myself to v8. I did not say anything like that, and in fact I asked for changes, and Wei said himself that, at least some of those were necessary.
Quoted 7 lines
Now, you've addressed those comments, and I'm happy about how the patch is looking now, so:
Reviewed-by Dario Faggioli <[email protected]>But I really think Wei (or Ian) should (re-)look and (re-)Ack.
I'm happy with this patch, too. So
Quoted 5 lines
I've found only a couple of style issues. I don't feel like blocking the series or asking to resend... perhaps they can be fixed during commit? Or I'm up for sending a cleanup patch myself (which would not introduce any functional change), as soon as this hit the repo.
IMHO a separate patch is better. Adjusting during committing in such large patch is error prone, plus there is huge backlog to be applied at the moment.
Wei.
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Re: [PATCH v9 for Xen 4.7 4/4] xl: enable per-VCPU parameter for RTDS
Quoted 9 lines · Wei Liu
Quoted 8 lines · Dario Faggioli
I've found only a couple of style issues. I don't feel like blocking
the series or asking to resend... perhaps they can be fixed during commit? Or I'm up for sending a cleanup patch myself (which would not
introduce any functional change), as soon as this hit the repo.
Quoted 5 lines
IMHO a separate patch is better. Adjusting during committing in such large patch is error prone, plus there is huge backlog to be applied at
the moment.
Ok, it makes sense.
I'll queue this up.
Regards,
Dario
Signature · 4 lines
<<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)
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
[hypervisor deadlock] Re: [PATCH v9 for Xen 4.7 1/4] xen: enable per-VCPU parameter for RTDS
In reply to Chong LiQuoted 25 lines · Chong Li
xen/common/sched_credit.c +4
-6@@ -1080,15 +1080,13 @@ csched_dom_cntl(* lock. Runq lock not needed anywhere in here. */ spin_lock_irqsave (&prv->lock, flags); -if ( op->cmd == XEN_DOMCTL_SCHEDOP_getinfo ) +switch ( op->cmd ) { +case XEN_DOMCTL_SCHEDOP_getinfo: op->u.credit.weight = sdom->weight; op->u.credit.cap = sdom->cap; - } -else - { -ASSERT (op->cmd == XEN_DOMCTL_SCHEDOP_putinfo); - +break ; +case XEN_DOMCTL_SCHEDOP_putinfo:if ( op->u.credit.weight !=0 ) {if ( !list_empty (&sdom->active_sdom_elem) )
xen/common/sched_credit.c csched_dom_cntl( · line 1104
Quoted 7 lines
xen/common/sched_credit.c +3
-1@@ -1101,7 +1099,9 @@ csched_dom_cntl(if ( op->u.credit.cap != (uint16_t )~0U ) sdom->cap = op->u.credit.cap; - +break ; +default : +return -EINVAL ;
This path returns without unlocking prv->lock.
Quoted 27 lines
xen/common/sched_credit.c +0
-0}spin_unlock_irqrestore (&prv->lock, flags);xen/common/sched_credit2.c +4
-6@@ -1421,14 +1421,12 @@ csched2_dom_cntl(* runq lock to update csvcs. */ spin_lock_irqsave (&prv->lock, flags); -if ( op->cmd == XEN_DOMCTL_SCHEDOP_getinfo ) +switch ( op->cmd ) { +case XEN_DOMCTL_SCHEDOP_getinfo: op->u.credit2.weight = sdom->weight; - } -else - { -ASSERT (op->cmd == XEN_DOMCTL_SCHEDOP_putinfo); - +break ; +case XEN_DOMCTL_SCHEDOP_putinfo:if ( op->u.credit2.weight !=0 ) {struct vcpu *v;
xen/common/sched_credit2.c csched2_dom_cntl( · line 1460
Quoted 6 lines
xen/common/sched_credit2.c +3
-0@@ -1457,6 +1455,9 @@ csched2_dom_cntl(vcpu_schedule_unlock (lock, svc->vcpu); } } +break ; +default : +return -EINVAL ;
As does this.
Please submit a bugfix ASAP. This will become a security vulnerability if Xen 4.7 is shipped without it being fixed.
xen/common/sched_credit2.c csched2_dom_cntl( · line 1463
Quoted 3 lines
xen/common/sched_credit2.c +0
-0}spin_unlock_irqrestore (&prv->lock, flags);
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Re: [hypervisor deadlock] Re: [PATCH v9 for Xen 4.7 1/4] xen: enable per-VCPU parameter for RTDS
Quoted 72 lines · Andrew Cooper
Quoted 25 lines · Chong Li
xen/common/sched_credit.c +4
-6@@ -1080,15 +1080,13 @@ csched_dom_cntl(* lock. Runq lock not needed anywhere in here. */ spin_lock_irqsave (&prv->lock, flags); -if ( op->cmd == XEN_DOMCTL_SCHEDOP_getinfo ) +switch ( op->cmd ) { +case XEN_DOMCTL_SCHEDOP_getinfo: op->u.credit.weight = sdom->weight; op->u.credit.cap = sdom->cap; - } -else - { -ASSERT (op->cmd == XEN_DOMCTL_SCHEDOP_putinfo); - +break ; +case XEN_DOMCTL_SCHEDOP_putinfo:if ( op->u.credit.weight !=0 ) {if ( !list_empty (&sdom->active_sdom_elem) )xen/common/sched_credit.c csched_dom_cntl( · line 1104
Quoted 7 lines
xen/common/sched_credit.c +3
-1@@ -1101,7 +1099,9 @@ csched_dom_cntl(if ( op->u.credit.cap != (uint16_t )~0U ) sdom->cap = op->u.credit.cap; - +break ; +default : +return -EINVAL ;This path returns without unlocking
prv->lock.Quoted 27 lines
xen/common/sched_credit.c +0
-0}spin_unlock_irqrestore (&prv->lock, flags);xen/common/sched_credit2.c +4
-6@@ -1421,14 +1421,12 @@ csched2_dom_cntl(* runq lock to update csvcs. */ spin_lock_irqsave (&prv->lock, flags); -if ( op->cmd == XEN_DOMCTL_SCHEDOP_getinfo ) +switch ( op->cmd ) { +case XEN_DOMCTL_SCHEDOP_getinfo: op->u.credit2.weight = sdom->weight; - } -else - { -ASSERT (op->cmd == XEN_DOMCTL_SCHEDOP_putinfo); - +break ; +case XEN_DOMCTL_SCHEDOP_putinfo:if ( op->u.credit2.weight !=0 ) {struct vcpu *v;xen/common/sched_credit2.c csched2_dom_cntl( · line 1460
Quoted 6 lines
xen/common/sched_credit2.c +3
-0@@ -1457,6 +1455,9 @@ csched2_dom_cntl(vcpu_schedule_unlock (lock, svc->vcpu); } } +break ; +default : +return -EINVAL ;As does this.
Quoted 7 lines
Please submit a bugfix ASAP. This will become a security vulnerability if Xen 4.7 is shipped without it being fixed.
Quoted 3 lines
xen/common/sched_credit2.c +0
-0}spin_unlock_irqrestore (&prv->lock, flags);
Thanks for pointing this out.
Dario, do you want to include this bugfix in your cleanup patch, or let me submit this?
Chong
Signature · 8 lines
Chong Li Department of Computer Science and Engineering Washington University in St.louis _______________________________________________ Xen-devel mailing list [email protected] http://lists.xen.org/xen-devel
Re: [hypervisor deadlock] Re: [PATCH v9 for Xen 4.7 1/4] xen: enable per-VCPU parameter for RTDS
Quoted 77 lines · Chong Li
Quoted 75 lines · Andrew Cooper
Quoted 25 lines · Chong Li
xen/common/sched_credit.c +4
-6@@ -1080,15 +1080,13 @@ csched_dom_cntl(* lock. Runq lock not needed anywhere in here. */ spin_lock_irqsave (&prv->lock, flags); -if ( op->cmd == XEN_DOMCTL_SCHEDOP_getinfo ) +switch ( op->cmd ) { +case XEN_DOMCTL_SCHEDOP_getinfo: op->u.credit.weight = sdom->weight; op->u.credit.cap = sdom->cap; - } -else - { -ASSERT (op->cmd == XEN_DOMCTL_SCHEDOP_putinfo); - +break ; +case XEN_DOMCTL_SCHEDOP_putinfo:if ( op->u.credit.weight !=0 ) {if ( !list_empty (&sdom->active_sdom_elem) )xen/common/sched_credit.c csched_dom_cntl( · line 1104
Quoted 7 lines
xen/common/sched_credit.c +3
-1@@ -1101,7 +1099,9 @@ csched_dom_cntl(if ( op->u.credit.cap != (uint16_t )~0U ) sdom->cap = op->u.credit.cap; - +break ; +default : +return -EINVAL ;This path returns without unlocking
prv->lock.Quoted 27 lines
xen/common/sched_credit.c +0
-0}spin_unlock_irqrestore (&prv->lock, flags);xen/common/sched_credit2.c +4
-6@@ -1421,14 +1421,12 @@ csched2_dom_cntl(* runq lock to update csvcs. */ spin_lock_irqsave (&prv->lock, flags); -if ( op->cmd == XEN_DOMCTL_SCHEDOP_getinfo ) +switch ( op->cmd ) { +case XEN_DOMCTL_SCHEDOP_getinfo: op->u.credit2.weight = sdom->weight; - } -else - { -ASSERT (op->cmd == XEN_DOMCTL_SCHEDOP_putinfo); - +break ; +case XEN_DOMCTL_SCHEDOP_putinfo:if ( op->u.credit2.weight !=0 ) {struct vcpu *v;xen/common/sched_credit2.c csched2_dom_cntl( · line 1460
Quoted 6 lines
xen/common/sched_credit2.c +3
-0@@ -1457,6 +1455,9 @@ csched2_dom_cntl(vcpu_schedule_unlock (lock, svc->vcpu); } } +break ; +default : +return -EINVAL ;As does this.
Please submit a bugfix ASAP. This will become a security vulnerability if Xen 4.7 is shipped without it being fixed.
Quoted 8 lines
Quoted 4 lines
xen/common/sched_credit2.c csched2_dom_cntl( · line 1463
Quoted 3 lines
xen/common/sched_credit2.c +0
-0}spin_unlock_irqrestore (&prv->lock, flags);Thanks for pointing this out.
Dario, do you want to include this bugfix in your cleanup patch, or let me submit this?
If you're around and can test it, it's probably better if you can send a patch right a way.
Thanks,
-George
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Re: [hypervisor deadlock] Re: [PATCH v9 for Xen 4.7 1/4] xen: enable per-VCPU parameter for RTDS
Quoted 42 lines · George Dunlap
Quoted 41 lines · Chong Li
Quoted 39 lines · Andrew Cooper
Quoted 23 lines · Chong Li
xen/common/sched_credit2.c +4
-6@@ -1421,14 +1421,12 @@ csched2_dom_cntl(* runq lock to update csvcs. */ spin_lock_irqsave(&prv->lock, flags); - if ( op->cmd == XEN_DOMCTL_SCHEDOP_getinfo ) + switch ( op->cmd ) { + case XEN_DOMCTL_SCHEDOP_getinfo: op->u.credit2.weight = sdom->weight; - } - else - { - ASSERT(op->cmd == XEN_DOMCTL_SCHEDOP_putinfo); - + break; + case XEN_DOMCTL_SCHEDOP_putinfo: if ( op->u.credit2.weight != 0 ) { struct vcpu *v;xen/common/sched_credit2.c csched2_dom_cntl( · line 1460
Quoted 6 lines
xen/common/sched_credit2.c +3
-0@@ -1457,6 +1455,9 @@ csched2_dom_cntl( vcpu_schedule_unlock(lock, svc->vcpu); } } + break; + default: + return -EINVAL;As does this.
Please submit a bugfix ASAP. This will become a security vulnerability
if Xen 4.7 is shipped without it being fixed.Quoted 3 lines
xen/common/sched_credit2.c +0
-0}
Quoted 9 lines
Quoted 5 lines
Quoted 1 line
xen/common/sched_credit2.c csched2_dom_cntl( · line 1463
Quoted 1 line
xen/common/sched_credit2.c +0
-0spin_unlock_irqrestore(&prv->lock, flags);Thanks for pointing this out.
Dario, do you want to include this bugfix in your cleanup patch, or let me submit this?
If you're around and can test it, it's probably better if you can send a
patch right a way.
Exactly. In fact:
- we don't fold bugfixes in clanups,
- I think I mentioned wanting to cleanup some code duplication in libxl, this is in xen,
- cleanups are delayed to 4.8, while this must be fixed before release (or the patch/the whole feature be reverted).
So, if you can't work out a fix today or, at most, tomorrow, let me know and I'll do it myself.
Sorry for not catching this during review... :-/
Regards,
Dario
Signature · 4 lines
<<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)
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Re: [hypervisor deadlock] Re: [PATCH v9 for Xen 4.7 1/4] xen: enable per-VCPU parameter for RTDS
Quoted 59 lines · Dario Faggioli
Quoted 42 lines · George Dunlap
Quoted 41 lines · Chong Li
Quoted 39 lines · Andrew Cooper
Quoted 23 lines · Chong Li
xen/common/sched_credit2.c +4
-6@@ -1421,14 +1421,12 @@ csched2_dom_cntl(* runq lock to update csvcs. */ spin_lock_irqsave(&prv->lock, flags); - if ( op->cmd == XEN_DOMCTL_SCHEDOP_getinfo ) + switch ( op->cmd ) { + case XEN_DOMCTL_SCHEDOP_getinfo: op->u.credit2.weight = sdom->weight; - } - else - { - ASSERT(op->cmd == XEN_DOMCTL_SCHEDOP_putinfo); - + break; + case XEN_DOMCTL_SCHEDOP_putinfo: if ( op->u.credit2.weight != 0 ) { struct vcpu *v;xen/common/sched_credit2.c csched2_dom_cntl( · line 1460
Quoted 6 lines
xen/common/sched_credit2.c +3
-0@@ -1457,6 +1455,9 @@ csched2_dom_cntl( vcpu_schedule_unlock(lock, svc->vcpu); } } + break; + default: + return -EINVAL;As does this.
Please submit a bugfix ASAP. This will become a security vulnerability
if Xen 4.7 is shipped without it being fixed.Quoted 3 lines
xen/common/sched_credit2.c +0
-0}Quoted 9 lines
Quoted 5 lines
Quoted 1 line
xen/common/sched_credit2.c csched2_dom_cntl( · line 1463
Quoted 1 line
xen/common/sched_credit2.c +0
-0spin_unlock_irqrestore(&prv->lock, flags);Thanks for pointing this out.
Dario, do you want to include this bugfix in your cleanup patch, or let me submit this?
If you're around and can test it, it's probably better if you can send a
patch right a way.Exactly. In fact:
- we don't fold bugfixes in clanups,
- I think I mentioned wanting to cleanup some code duplication in libxl, this is in xen,
- cleanups are delayed to 4.8, while this must be fixed before release (or the patch/the whole feature be reverted).
Quoted 3 lines
So, if you can't work out a fix today or, at most, tomorrow, let me know and I'll do it myself.
Yes, please fix this by tomorrow. I think it is quite straightforward to fix anyway.
Wei.
Quoted 10 lines
Sorry for not catching this during review... :-/
Regards,
DarioSignature · 4 lines
<<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)
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Re: [hypervisor deadlock] Re: [PATCH v9 for Xen 4.7 1/4] xen: enable per-VCPU parameter for RTDS
Quoted 60 lines · Wei Liu
Quoted 59 lines · Dario Faggioli
Quoted 42 lines · George Dunlap
Quoted 41 lines · Chong Li
Quoted 39 lines · Andrew Cooper
Quoted 23 lines · Chong Li
xen/common/sched_credit2.c +4
-6@@ -1421,14 +1421,12 @@ csched2_dom_cntl(* runq lock to update csvcs. */ spin_lock_irqsave (&prv->lock, flags); -if ( op->cmd == XEN_DOMCTL_SCHEDOP_getinfo ) +switch ( op->cmd ) { +case XEN_DOMCTL_SCHEDOP_getinfo: op->u.credit2.weight = sdom->weight; - } -else - { -ASSERT (op->cmd == XEN_DOMCTL_SCHEDOP_putinfo); - +break ; +case XEN_DOMCTL_SCHEDOP_putinfo:if ( op->u.credit2.weight !=0 ) {struct vcpu *v;xen/common/sched_credit2.c csched2_dom_cntl( · line 1460
Quoted 6 lines
xen/common/sched_credit2.c +3
-0@@ -1457,6 +1455,9 @@ csched2_dom_cntl(vcpu_schedule_unlock (lock, svc->vcpu); } } +break ; +default : +return -EINVAL ;As does this.
Please submit a bugfix ASAP. This will become a security vulnerability
if Xen 4.7 is shipped without it being fixed.Quoted 3 lines
xen/common/sched_credit2.c +0
-0}Quoted 9 lines
Quoted 5 lines
Quoted 1 line
xen/common/sched_credit2.c csched2_dom_cntl( · line 1463
Quoted 1 line
xen/common/sched_credit2.c +0
-0spin_unlock_irqrestore (&prv->lock, flags);Thanks for pointing this out.
Dario, do you want to include this bugfix in your cleanup patch, or let me submit this?
If you're around and can test it, it's probably better if you can send a
patch right a way.Exactly. In fact:
- we don't fold bugfixes in clanups,
- I think I mentioned wanting to cleanup some code duplication in libxl, this is in xen,
- cleanups are delayed to 4.8, while this must be fixed before release (or the patch/the whole feature be reverted).
Quoted 9 lines
Quoted 3 lines
So, if you can't work out a fix today or, at most, tomorrow, let me know and I'll do it myself.
Yes, please fix this by tomorrow. I think it is quite straightforward to fix anyway.
Wei.
Will do.
Signature · 8 lines
Chong Li Department of Computer Science and Engineering Washington University in St.louis _______________________________________________ Xen-devel mailing list [email protected] http://lists.xen.org/xen-devel
Re: [PATCH v9 for Xen 4.7 3/4] libxl: enable per-VCPU parameter for RTDS
In reply to Wei LiuWei Liu writes ("Re: [PATCH v9 for Xen 4.7 3/4] libxl: enable per-VCPU parameter for RTDS"):
Quoted 11 lines · Chong Li
Quoted 8 lines
Add libxl_vcpu_sched_params_get/set and sched_rtds_vcpu_get/set functions to support per-VCPU settings.
Signed-off-by Chong Li <[email protected]>Signed-off-by Meng Xu <[email protected]>Signed-off-by Sisu Xi <[email protected]>Acked-by Wei Liu <[email protected]>This should have been dropped.
...
Quoted 4 lines
These two functions LGTM, so I shall ack this patch again:
Acked-by Wei Liu <[email protected]>
I have queued this patch.
Ian.
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Re: [PATCH v9 for Xen 4.7 3/4] libxl: enable per-VCPU parameter for RTDS
Ian Jackson writes ("Re: [PATCH v9 for Xen 4.7 3/4] libxl: enable per-VCPU parameter for RTDS"):
Quoted 6 lines
Wei Liu writes ("Re: [PATCH v9 for Xen 4.7 3/4] libxl: enable per-VCPU parameter for RTDS"):
Quoted 3 lines
These two functions LGTM, so I shall ack this patch again:
Acked-by Wei Liu <[email protected]>I have queued this patch.
It broke the build, see below. Was this patch build-tested ? I have dropped it.
Ian.
libxl.c: In function 'sched_rtds_vcpu_get':
libxl.c:5980:5: error: implicit declaration of function 'xc_sched_rtds_vcpu_get' [-Werror=implicit-function-declaration] libxl.c: In function 'sched_rtds_vcpu_set':
libxl.c:6088:5: error: implicit declaration of function 'xc_sched_rtds_vcpu_set' [-Werror=implicit-function-declaration]
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Re: [PATCH v9 for Xen 4.7 3/4] libxl: enable per-VCPU parameter for RTDS
Quoted 11 lines · Ian Jackson
Ian Jackson writes ("Re: [PATCH v9 for Xen 4.7 3/4] libxl: enable per-VCPU parameter for RTDS"):
Quoted 6 lines
Wei Liu writes ("Re: [PATCH v9 for Xen 4.7 3/4] libxl: enable per-VCPU parameter for RTDS"):
Quoted 3 lines
These two functions LGTM, so I shall ack this patch again:
Acked-by Wei Liu <[email protected]>I have queued this patch.
It broke the build, see below. Was this patch build-tested ? I have dropped it.
Quoted 6 lines
Ian.
libxl.c: In function 'sched_rtds_vcpu_get':
libxl.c:5980:5: error: implicit declaration of function 'xc_sched_rtds_vcpu_get' [-Werror=implicit-function-declaration]libxl.c: In function 'sched_rtds_vcpu_set':
libxl.c:6088:5: error: implicit declaration of function 'xc_sched_rtds_vcpu_set' [-Werror=implicit-function-declaration]
Hi Chong,
I could have fixed this for you, but I think it would be useful to you if you address this problem.
I suggest you:
1. Fold in Reviewed-by and Acked-by tags to your patches.
2. Rebase these three patches on top of staging branch.
3. Use the following rune to build test every single commit and fix the problem if it fails.
$ git rebase -i HEAD~3 --exec "make -j4 clean && ./configure && \
make -j4 dist"It will stop rebasing if one commit doesn't build. This is what I normally do when developing.
Note that the deadline for applying patches is Friday, so if you can refresh this by tomorrow that would be good.
Wei.
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Re: [PATCH v9 for Xen 4.7 3/4] libxl: enable per-VCPU parameter for RTDS
Wei Liu writes ("Re: [PATCH v9 for Xen 4.7 3/4] libxl: enable per-VCPU parameter for RTDS"):
Quoted 6 lines · Ian Jackson
Quoted 4 lines
libxl.c: In function 'sched_rtds_vcpu_get':
libxl.c:5980:5: error: implicit declaration of function 'xc_sched_rtds_vcpu_get' [-Werror=implicit-function-declaration]libxl.c: In function 'sched_rtds_vcpu_set':
libxl.c:6088:5: error: implicit declaration of function 'xc_sched_rtds_vcpu_set' [-Werror=implicit-function-declaration]
...
Quoted 10 lines
I could have fixed this for you, but I think it would be useful to you if you address this problem.
I suggest you:
1. Fold in Reviewed-by and Acked-by tags to your patches.
2. Rebase these three patches on top of staging branch.
3. Use the following rune to build test every single commit and fix the problem if it fails.
Quoted 8 lines
$ git rebase -i HEAD~3 --exec "make -j4 clean && ./configure && \ make -j4 dist"It will stop rebasing if one commit doesn't build. This is what I normally do when developing.
Note that the deadline for applying patches is Friday, so if you can refresh this by tomorrow that would be good.
Dario points out on irc that perhaps the problem is that I didn't apply 2/4. I wasn't CC'd on 2/4, so I foolishly assumed it was a hypervisor patch (and the HV parts are already in tree).
I will check my view of the xen-devel list.
Ian.
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Re: [PATCH v9 for Xen 4.7 3/4] libxl: enable per-VCPU parameter for RTDS
Ian Jackson writes ("Re: [PATCH v9 for Xen 4.7 3/4] libxl: enable per-VCPU parameter for RTDS"):
Quoted 5 lines
Dario points out on irc that perhaps the problem is that I didn't apply 2/4. I wasn't CC'd on 2/4, so I foolishly assumed it was a hypervisor patch (and the HV parts are already in tree).
I will check my view of the xen-devel list.
Indeed. With 2/4 it builds. 4/4 was also not CC'd to me. I used a copy from the list.
I have pushed all four.
Ian.
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Re: [PATCH v9 for Xen 4.7 3/4] libxl: enable per-VCPU parameter for RTDS
Quoted 7 lines · Ian Jackson
Ian Jackson writes ("Re: [PATCH v9 for Xen 4.7 3/4] libxl: enable per-VCPU parameter for RTDS"):
Quoted 5 lines
Dario points out on irc that perhaps the problem is that I didn't apply 2/4. I wasn't CC'd on 2/4, so I foolishly assumed it was a hypervisor patch (and the HV parts are already in tree).
Quoted 6 lines
Quoted 1 line
I will check my view of the xen-devel list.
Indeed. With 2/4 it builds. 4/4 was also not CC'd to me. I used a copy from the list.
I have pushed all four.
Thanks Ian!
So, Chong, clearly, the build failure was not your fault (as there is no actual build failure), but please, always double check (even when sending new versions of a series) that the appropriate maintainers are Cc-ed... This would help limiting problems like this one we've seen here.
Regards,
Dario
Signature · 4 lines
<<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)
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Re: [PATCH v9 for Xen 4.7 3/4] libxl: enable per-VCPU parameter for RTDS
Quoted 14 lines · Dario Faggioli
Quoted 7 lines · Ian Jackson
Ian Jackson writes ("Re: [PATCH v9 for Xen 4.7 3/4] libxl: enable per-VCPU parameter for RTDS"):
Quoted 5 lines
Dario points out on irc that perhaps the problem is that I didn't apply 2/4. I wasn't CC'd on 2/4, so I foolishly assumed it was a hypervisor patch (and the HV parts are already in tree).
Quoted 6 lines
Quoted 1 line
I will check my view of the xen-devel list.
Indeed. With 2/4 it builds. 4/4 was also not CC'd to me. I used a copy from the list.
I have pushed all four.
Quoted 8 lines
Thanks Ian!
So, Chong, clearly, the build failure was not your fault (as there is no actual build failure), but please, always double check (even when sending new versions of a series) that the appropriate maintainers are Cc-ed... This would help limiting problems like this one we've seen here.
Yes, I'll.
Thanks for your help on this.
Chong
Signature · 8 lines
Chong Li Department of Computer Science and Engineering Washington University in St.louis _______________________________________________ Xen-devel mailing list [email protected] http://lists.xen.org/xen-devel
Re: [PATCH v9 for Xen 4.7 3/4] libxl: enable per-VCPU parameter for RTDS
Quoted 23 lines · Chong Li
Quoted 13 lines · Dario Faggioli
Quoted 6 lines · Ian Jackson
Ian Jackson writes ("Re: [PATCH v9 for Xen 4.7 3/4] libxl: enable per-VCPU parameter for RTDS"):
Quoted 4 lines
Dario points out on irc that perhaps the problem is that I didn't apply 2/4. I wasn't CC'd on 2/4, so I foolishly assumed it was a hypervisor patch (and the HV parts are already in tree).
Quoted 6 lines
Quoted 1 line
I will check my view of the xen-devel list.
Indeed. With 2/4 it builds. 4/4 was also not CC'd to me. I used a copy from the list.
I have pushed all four.
Quoted 8 lines
Thanks Ian!
So, Chong, clearly, the build failure was not your fault (as there is no actual build failure), but please, always double check (even when sending new versions of a series) that the appropriate maintainers are Cc-ed... This would help limiting problems like this one we've seen here.
Quoted 4 lines
Yes, I'll.
Thanks for your help on this.
Chong
Yet another build failure on CentOS.
xc_rt.c: In function 'xc_sched_rtds_vcpu_set':
xc_rt.c:71:9: error: 'rc' may be used uninitialized in this function [-Werror=maybe-uninitialized]
int rc;
^
xc_rt.c: In function 'xc_sched_rtds_vcpu_get':
xc_rt.c:105:9: error: 'rc' may be used uninitialized in this function
[-Werror=maybe-uninitialized]
int rc;
^cc1: all warnings being treated as errors
In both cases, if your while loop doesn't execute (i.e. the user passes num_vcpus = 0), rc is genuinely uninialised when used at the end of the function.
~Andrew
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Re: [PATCH v9 for Xen 4.7 3/4] libxl: enable per-VCPU parameter for RTDS
Quoted 41 lines · Andrew Cooper
Quoted 23 lines · Chong Li
Quoted 13 lines · Dario Faggioli
Quoted 6 lines · Ian Jackson
Ian Jackson writes ("Re: [PATCH v9 for Xen 4.7 3/4] libxl: enable per-VCPU parameter for RTDS"):
Quoted 4 lines
Dario points out on irc that perhaps the problem is that I didn't apply 2/4. I wasn't CC'd on 2/4, so I foolishly assumed it was a hypervisor patch (and the HV parts are already in tree).
Quoted 6 lines
Quoted 1 line
I will check my view of the xen-devel list.
Indeed. With 2/4 it builds. 4/4 was also not CC'd to me. I used a copy from the list.
I have pushed all four.
Quoted 8 lines
Thanks Ian!
So, Chong, clearly, the build failure was not your fault (as there is no actual build failure), but please, always double check (even when sending new versions of a series) that the appropriate maintainers are Cc-ed... This would help limiting problems like this one we've seen here.
Quoted 4 lines
Yes, I'll.
Thanks for your help on this.
ChongYet another build failure on CentOS.
xc_rt.c: In function 'xc_sched_rtds_vcpu_set':
xc_rt.c:71:9: error: 'rc' may be used uninitialized in this function [-Werror=maybe-uninitialized]int rc; ^ xc_rt.c: In function 'xc_sched_rtds_vcpu_get': xc_rt.c:105:9: error: 'rc' may be used uninitialized in this function [-Werror=maybe-uninitialized] int rc; ^
Quoted 7 lines
cc1: all warnings being treated as errors
In both cases, if your while loop doesn't execute (i.e. the user passes
num_vcpus= 0), rc is genuinely uninialised when used at the end of the function.~Andrew
I see. I can do a sanity check on num_vcpus before the while loop.
Do I have to re-send the whole patch series? Or maybe just something like a bug fix patch?
Chong
Signature · 8 lines
Chong Li Department of Computer Science and Engineering Washington University in St.louis _______________________________________________ Xen-devel mailing list [email protected] http://lists.xen.org/xen-devel
Re: [PATCH v9 for Xen 4.7 3/4] libxl: enable per-VCPU parameter for RTDS
Quoted 47 lines · Chong Li
Quoted 46 lines · Andrew Cooper
Quoted 23 lines · Chong Li
Quoted 13 lines · Dario Faggioli
Quoted 6 lines · Ian Jackson
Ian Jackson writes ("Re: [PATCH v9 for Xen 4.7 3/4] libxl: enable per-VCPU parameter for RTDS"):
Quoted 4 lines
Dario points out on irc that perhaps the problem is that I didn't apply 2/4. I wasn't CC'd on 2/4, so I foolishly assumed it was a hypervisor patch (and the HV parts are already in tree).
Quoted 6 lines
Quoted 1 line
I will check my view of the xen-devel list.
Indeed. With 2/4 it builds. 4/4 was also not CC'd to me. I used a copy from the list.
I have pushed all four.
Quoted 8 lines
Thanks Ian!
So, Chong, clearly, the build failure was not your fault (as there is no actual build failure), but please, always double check (even when sending new versions of a series) that the appropriate maintainers are Cc-ed... This would help limiting problems like this one we've seen here.
Quoted 4 lines
Yes, I'll.
Thanks for your help on this.
ChongYet another build failure on CentOS.
xc_rt.c: In function 'xc_sched_rtds_vcpu_set':
xc_rt.c:71:9: error: 'rc' may be used uninitialized in this function [-Werror=maybe-uninitialized]int rc; ^ xc_rt.c: In function 'xc_sched_rtds_vcpu_get': xc_rt.c:105:9: error: 'rc' may be used uninitialized in this function [-Werror=maybe-uninitialized] int rc; ^cc1: all warnings being treated as errors
In both cases, if your while loop doesn't execute (i.e. the user passes
num_vcpus= 0), rc is genuinely uninialised when used at the end of the function.
Quoted 5 lines
Quoted 1 line
~Andrew
I see. I can do a sanity check on
num_vcpusbefore the while loop.Do I have to re-send the whole patch series? Or maybe just something like a bug fix patch?
The series has been committed.
Please send a new patch based on top of the existing staging branch.
~Andrew
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Re: [PATCH v9 for Xen 4.7 3/4] libxl: enable per-VCPU parameter for RTDS
In reply to Chong LiQuoted 44 lines · Chong Li
Quoted 43 lines · Andrew Cooper
Quoted 23 lines · Chong Li
Quoted 13 lines · Dario Faggioli
Quoted 6 lines · Ian Jackson
Ian Jackson writes ("Re: [PATCH v9 for Xen 4.7 3/4] libxl: enable per-VCPU parameter for RTDS"):
Quoted 4 lines
Dario points out on irc that perhaps the problem is that I didn't apply 2/4. I wasn't CC'd on 2/4, so I foolishly assumed it was a hypervisor patch (and the HV parts are already in tree).
Quoted 6 lines
Quoted 1 line
I will check my view of the xen-devel list.
Indeed. With 2/4 it builds. 4/4 was also not CC'd to me. I used a copy from the list.
I have pushed all four.
Quoted 8 lines
Thanks Ian!
So, Chong, clearly, the build failure was not your fault (as there is no actual build failure), but please, always double check (even when sending new versions of a series) that the appropriate maintainers are Cc-ed... This would help limiting problems like this one we've seen here.
Quoted 4 lines
Yes, I'll.
Thanks for your help on this.
ChongYet another build failure on CentOS.
xc_rt.c: In function 'xc_sched_rtds_vcpu_set':
xc_rt.c:71:9: error: 'rc' may be used uninitialized in this function [-Werror=maybe-uninitialized]int rc; ^ xc_rt.c: In function 'xc_sched_rtds_vcpu_get': xc_rt.c:105:9: error: 'rc' may be used uninitialized in this function [-Werror=maybe-uninitialized] int rc; ^cc1: all warnings being treated as errors
Quoted 8 lines
Quoted 5 lines
In both cases, if your while loop doesn't execute (i.e. the user passes
num_vcpus= 0), rc is genuinely uninialised when used at the end of the function.~Andrew
I see. I can do a sanity check on
num_vcpusbefore the while loop.
Not sure what kind of sanity check you were thinking about. But you can just set rc = 0 at the beginning of each function. That semantics should be sensible enough. What do you think?
Quoted 3 lines
Do I have to re-send the whole patch series? Or maybe just something like a bug fix patch?
Please send a patch on top of staging branch. This series has already been committed.
Wei.
Quoted 6 lines
Chong
Signature · 3 lines
Chong Li Department of Computer Science and Engineering Washington University in St.louis
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Re: [PATCH v9 for Xen 4.7 3/4] libxl: enable per-VCPU parameter for RTDS
Quoted 49 lines · Wei Liu
Quoted 48 lines · Chong Li
Quoted 47 lines · Andrew Cooper
Quoted 23 lines · Chong Li
Quoted 13 lines · Dario Faggioli
Quoted 6 lines · Ian Jackson
Ian Jackson writes ("Re: [PATCH v9 for Xen 4.7 3/4] libxl: enable per-VCPU parameter for RTDS"):
Quoted 4 lines
Dario points out on irc that perhaps the problem is that I didn't apply 2/4. I wasn't CC'd on 2/4, so I foolishly assumed it was a hypervisor patch (and the HV parts are already in tree).
Quoted 6 lines
Quoted 1 line
I will check my view of the xen-devel list.
Indeed. With 2/4 it builds. 4/4 was also not CC'd to me. I used a copy from the list.
I have pushed all four.
Quoted 8 lines
Thanks Ian!
So, Chong, clearly, the build failure was not your fault (as there is no actual build failure), but please, always double check (even when sending new versions of a series) that the appropriate maintainers are Cc-ed... This would help limiting problems like this one we've seen here.
Quoted 4 lines
Yes, I'll.
Thanks for your help on this.
ChongYet another build failure on CentOS.
xc_rt.c: In function 'xc_sched_rtds_vcpu_set':
xc_rt.c:71:9: error: 'rc' may be used uninitialized in this function [-Werror=maybe-uninitialized]int rc; ^ xc_rt.c: In function 'xc_sched_rtds_vcpu_get': xc_rt.c:105:9: error: 'rc' may be used uninitialized in this function [-Werror=maybe-uninitialized] int rc; ^cc1: all warnings being treated as errors
In both cases, if your while loop doesn't execute (i.e. the user passes
num_vcpus= 0), rc is genuinely uninialised when used at the end of the function.
Quoted 8 lines
Quoted 4 lines
Quoted 1 line
~Andrew
I see. I can do a sanity check on
num_vcpusbefore the while loop.Not sure what kind of sanity check you were thinking about. But you can just set rc = 0 at the beginning of each function. That semantics should be sensible enough. What do you think?
Yes, I can do this change. But didn't you or Dario say that rc should not be initialized at the beginning of a function?
Quoted 8 lines
Quoted 4 lines
Do I have to re-send the whole patch series? Or maybe just something like a bug fix patch?
Please send a patch on top of staging branch. This series has already been committed.
Sure.
Signature · 8 lines
Chong Li Department of Computer Science and Engineering Washington University in St.louis _______________________________________________ Xen-devel mailing list [email protected] http://lists.xen.org/xen-devel
Re: [PATCH v9 for Xen 4.7 3/4] libxl: enable per-VCPU parameter for RTDS
Quoted 52 lines · Chong Li
Quoted 51 lines · Wei Liu
Quoted 50 lines · Chong Li
Quoted 48 lines · Andrew Cooper
Quoted 23 lines · Chong Li
Quoted 13 lines · Dario Faggioli
Quoted 6 lines · Ian Jackson
Ian Jackson writes ("Re: [PATCH v9 for Xen 4.7 3/4] libxl: enable per-VCPU parameter for RTDS"):
Quoted 4 lines
Dario points out on irc that perhaps the problem is that I didn't apply 2/4. I wasn't CC'd on 2/4, so I foolishly assumed it was a hypervisor patch (and the HV parts are already in tree).
Quoted 6 lines
Quoted 1 line
I will check my view of the xen-devel list.
Indeed. With 2/4 it builds. 4/4 was also not CC'd to me. I used a copy from the list.
I have pushed all four.
Quoted 8 lines
Thanks Ian!
So, Chong, clearly, the build failure was not your fault (as there is no actual build failure), but please, always double check (even when sending new versions of a series) that the appropriate maintainers are Cc-ed... This would help limiting problems like this one we've seen here.
Quoted 4 lines
Yes, I'll.
Thanks for your help on this.
ChongYet another build failure on CentOS.
xc_rt.c: In function 'xc_sched_rtds_vcpu_set':
xc_rt.c:71:9: error: 'rc' may be used uninitialized in this function [-Werror=maybe-uninitialized]int rc; ^ xc_rt.c: In function 'xc_sched_rtds_vcpu_get': xc_rt.c:105:9: error: 'rc' may be used uninitialized in this function [-Werror=maybe-uninitialized] int rc; ^cc1: all warnings being treated as errors
In both cases, if your while loop doesn't execute (i.e. the user passes
num_vcpus= 0), rc is genuinely uninialised when used at the end of the function.~Andrew
Quoted 9 lines
Quoted 6 lines
Quoted 2 lines
I see. I can do a sanity check on
num_vcpusbefore the while loop.Not sure what kind of sanity check you were thinking about. But you can just set rc = 0 at the beginning of each function. That semantics should be sensible enough. What do you think?
Yes, I can do this change. But didn't you or Dario say that rc should not be initialized at the beginning of a function?
I'm fine with bending the rules a bit to make life easier. For a simple function like this I won't argue one way or another. Besides there isn't really a CODING_STYLE file in libxc.
But really what I care about is to not return an uninitialised rc. If you don't want to set rc to 0 at the beginning of the function, you can do it before the loop -- that should both fix the error and make Dario happy. :-)
Wei.
Quoted 16 lines
Quoted 8 lines
Quoted 4 lines
Do I have to re-send the whole patch series? Or maybe just something like a bug fix patch?
Please send a patch on top of staging branch. This series has already been committed.
Sure.
Signature · 3 lines
Chong Li Department of Computer Science and Engineering Washington University in St.louis
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Re: [PATCH v9 for Xen 4.7 3/4] libxl: enable per-VCPU parameter for RTDS
Quoted 13 lines · Wei Liu
Quoted 8 lines · Chong Li
Quoted 6 lines · Wei Liu
On Wed, Apr 06, 2016 at 02:20:55PM -0500, Chong Li wrote:
Not sure what kind of sanity check you were thinking about. But you can
just set rc = 0 at the beginning of each function. That semantics should
be sensible enough. What do you think?Quoted 4 lines
Yes, I can do this change. But didn't you or Dario say that rc should not be
initialized at the beginning of a function?
Quoted 6 lines
I'm fine with bending the rules a bit to make life easier. For a simple
function like this I won't argue one way or another. Besides there isn't
really aCODING_STYLEfile in libxc.
I did say it, but it wasn't because of coding style, especially considering, as Wei says, that we're in libxc. I did because it looked a pointless (and hence avoidable) initialization.
Of course, I was wrong, as I did not see the issue in case we get passed 0. Also, weirdly enough, my compiler did not spot this (and I build on Debian unstable, so with a fairly recent gcc).
In any case, I don't think it make much sense to deal with num_vcpus=0, and in fact, in libxl, we reject it. But as a matter of fact, the easiest and cleanest way of "not dealing" with it, here in libxc, is really to just initialize rc to zero, let the loop be skipped and carry on.
More advanced sanity checking is better done at both higher and lower levels, and both are happening already, so we're fine.
Quoted 7 lines
But really what I care about is to not return an uninitialised rc. If you don't want to set rc to 0 at the beginning of the function, you can
do it before the loop -- that should both fix the error and make Dario
happy. :-)
Thanks for this effort of making me happy. :-)
Jokes apart, just initialize it and get done with this. Again, it's the cleanest and simplest way, and I _am_ happy with it.
Regards,
Dario
Signature · 4 lines
<<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)
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel