Message ID | 1501612434-5803-2-git-send-email-mengxu@cis.upenn.edu (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Tue, 2017-08-01 at 14:33 -0400, Meng Xu wrote: > --- a/xen/include/public/domctl.h > +++ b/xen/include/public/domctl.h > @@ -360,6 +360,7 @@ typedef struct xen_domctl_sched_credit2 { > typedef struct xen_domctl_sched_rtds { > uint32_t period; > uint32_t budget; > + bool is_work_conserving; > I wonder whether it wouldn't be better (e.g., more future proof) to have a 'uint32_T flags' field here too. That way, if/when, in future, we want to introduce some other way of tweaking the scheduler's behavior for this vCPU, we already have space for specifying it... Dario
On Thu, Aug 3, 2017 at 11:47 AM, Dario Faggioli <dario.faggioli@citrix.com> wrote: > On Tue, 2017-08-01 at 14:33 -0400, Meng Xu wrote: >> --- a/xen/include/public/domctl.h >> +++ b/xen/include/public/domctl.h >> @@ -360,6 +360,7 @@ typedef struct xen_domctl_sched_credit2 { >> typedef struct xen_domctl_sched_rtds { >> uint32_t period; >> uint32_t budget; >> + bool is_work_conserving; >> > I wonder whether it wouldn't be better (e.g., more future proof) to > have a 'uint32_T flags' field here too. > > That way, if/when, in future, we want to introduce some other way of > tweaking the scheduler's behavior for this vCPU, we already have space > for specifying it... > uint32_t flag sounds reasonable to me. I can do it in the next version. Meng ----------- Meng Xu PhD Candidate in Computer and Information Science University of Pennsylvania http://www.cis.upenn.edu/~mengxu/
diff --git a/xen/common/sched_rt.c b/xen/common/sched_rt.c index 740a712..76ed4cb 100644 --- a/xen/common/sched_rt.c +++ b/xen/common/sched_rt.c @@ -1442,6 +1442,7 @@ rt_dom_cntl( svc = rt_vcpu(d->vcpu[local_sched.vcpuid]); local_sched.u.rtds.budget = svc->budget / MICROSECS(1); local_sched.u.rtds.period = svc->period / MICROSECS(1); + local_sched.u.rtds.is_work_conserving = svc->is_work_conserving; spin_unlock_irqrestore(&prv->lock, flags); if ( copy_to_guest_offset(op->u.v.vcpus, index, @@ -1466,6 +1467,7 @@ rt_dom_cntl( svc = rt_vcpu(d->vcpu[local_sched.vcpuid]); svc->period = period; svc->budget = budget; + svc->is_work_conserving = local_sched.u.rtds.is_work_conserving; spin_unlock_irqrestore(&prv->lock, flags); } /* Process a most 64 vCPUs without checking for preemptions. */ diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h index ff39762..e67cd9e 100644 --- a/xen/include/public/domctl.h +++ b/xen/include/public/domctl.h @@ -360,6 +360,7 @@ typedef struct xen_domctl_sched_credit2 { typedef struct xen_domctl_sched_rtds { uint32_t period; uint32_t budget; + bool is_work_conserving; } xen_domctl_sched_rtds_t; typedef struct xen_domctl_schedparam_vcpu {
Extend the hypercalls(XEN_DOMCTL_SCHEDOP_getvcpuinfo/putvcpuinfo) to get/set a domain's per-VCPU work conserving parameters. Signed-off-by: Meng Xu <mengxu@cis.upenn.edu> --- xen/common/sched_rt.c | 2 ++ xen/include/public/domctl.h | 1 + 2 files changed, 3 insertions(+)