Message ID | 20160312113405.14480.20446.stgit@Solace.station (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Sat, Mar 12, 2016 at 6:34 AM, Dario Faggioli <dario.faggioli@citrix.com> wrote: > such as deadline and budget. Packing is necessary to make > it possible for xentrace_format to properly interpreet the > records. > > Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com> > --- > Cc: George Dunlap <george.dunlap@eu.citrix.com> > Cc: Meng Xu <mengxu@cis.upenn.edu> > --- Reviewed-by: Meng Xu <mengxu@cis.upenn.edu> ----------- Meng Xu PhD Student in Computer and Information Science University of Pennsylvania http://www.cis.upenn.edu/~mengxu/
>>> On 12.03.16 at 12:34, <dario.faggioli@citrix.com> wrote: > --- a/xen/common/sched_rt.c > +++ b/xen/common/sched_rt.c > @@ -361,17 +361,14 @@ rt_update_deadline(s_time_t now, struct rt_vcpu *svc) > > /* TRACE */ > { > - struct { > + struct __packed { > unsigned vcpu:16, dom:16; > - unsigned cur_deadline_lo, cur_deadline_hi; > - unsigned cur_budget_lo, cur_budget_hi; > + uint64_t cur_deadline, cur_budget; > } d; > d.dom = svc->vcpu->domain->domain_id; > d.vcpu = svc->vcpu->vcpu_id; > - d.cur_deadline_lo = (unsigned) svc->cur_deadline; > - d.cur_deadline_hi = (unsigned) (svc->cur_deadline >> 32); > - d.cur_budget_lo = (unsigned) svc->cur_budget; > - d.cur_budget_hi = (unsigned) (svc->cur_budget >> 32); > + d.cur_deadline = (uint64_t) svc->cur_deadline; > + d.cur_budget = (uint64_t) svc->cur_budget; I don't see the need for these cast (and similar ones further down), but you're the maintainer, so you know ... Jan
On Mon, 2016-03-14 at 03:07 -0600, Jan Beulich wrote: > > > > On 12.03.16 at 12:34, <dario.faggioli@citrix.com> wrote: > > --- a/xen/common/sched_rt.c > > +++ b/xen/common/sched_rt.c > > @@ -361,17 +361,14 @@ rt_update_deadline(s_time_t now, struct > > rt_vcpu *svc) > > > > /* TRACE */ > > { > > - struct { > > + struct __packed { > > unsigned vcpu:16, dom:16; > > - unsigned cur_deadline_lo, cur_deadline_hi; > > - unsigned cur_budget_lo, cur_budget_hi; > > + uint64_t cur_deadline, cur_budget; > > } d; > > d.dom = svc->vcpu->domain->domain_id; > > d.vcpu = svc->vcpu->vcpu_id; > > - d.cur_deadline_lo = (unsigned) svc->cur_deadline; > > - d.cur_deadline_hi = (unsigned) (svc->cur_deadline >> 32); > > - d.cur_budget_lo = (unsigned) svc->cur_budget; > > - d.cur_budget_hi = (unsigned) (svc->cur_budget >> 32); > > + d.cur_deadline = (uint64_t) svc->cur_deadline; > > + d.cur_budget = (uint64_t) svc->cur_budget; > I don't see the need for these cast (and similar ones further down), > but you're the maintainer, so you know ... > BTW, I saw you've committed this. Thanks for that, and sorry for not replying. I wanted to, but I've had a couple of day full of Internet connectivity issues. I do think it's best to keep the casts, although strictly unnecessary. About this series, I'm re-sending patch 1, by replying directly to that same email of this thread. So, for other maintainers (which I'm Cc-ing to this message), or should I say, for George :-), this is what should be considered for review: - [PATCH 1/3 v2] xenalyze: handle DOM0 operations events - [PATCH 3/3] xenalyze: handle RTDS scheduler events Thanks and Regards, Dario
diff --git a/xen/common/sched_rt.c b/xen/common/sched_rt.c index bfed2e2..8e51abe 100644 --- a/xen/common/sched_rt.c +++ b/xen/common/sched_rt.c @@ -361,17 +361,14 @@ rt_update_deadline(s_time_t now, struct rt_vcpu *svc) /* TRACE */ { - struct { + struct __packed { unsigned vcpu:16, dom:16; - unsigned cur_deadline_lo, cur_deadline_hi; - unsigned cur_budget_lo, cur_budget_hi; + uint64_t cur_deadline, cur_budget; } d; d.dom = svc->vcpu->domain->domain_id; d.vcpu = svc->vcpu->vcpu_id; - d.cur_deadline_lo = (unsigned) svc->cur_deadline; - d.cur_deadline_hi = (unsigned) (svc->cur_deadline >> 32); - d.cur_budget_lo = (unsigned) svc->cur_budget; - d.cur_budget_hi = (unsigned) (svc->cur_budget >> 32); + d.cur_deadline = (uint64_t) svc->cur_deadline; + d.cur_budget = (uint64_t) svc->cur_budget; trace_var(TRC_RTDS_BUDGET_REPLENISH, 1, sizeof(d), (unsigned char *) &d); @@ -711,16 +708,14 @@ burn_budget(const struct scheduler *ops, struct rt_vcpu *svc, s_time_t now) /* TRACE */ { - struct { + struct __packed { unsigned vcpu:16, dom:16; - unsigned cur_budget_lo; - unsigned cur_budget_hi; + uint64_t cur_budget; int delta; } d; d.dom = svc->vcpu->domain->domain_id; d.vcpu = svc->vcpu->vcpu_id; - d.cur_budget_lo = (unsigned) svc->cur_budget; - d.cur_budget_hi = (unsigned) (svc->cur_budget >> 32); + d.cur_budget = (uint64_t) svc->cur_budget; d.delta = delta; trace_var(TRC_RTDS_BUDGET_BURN, 1, sizeof(d), @@ -763,17 +758,14 @@ __runq_pick(const struct scheduler *ops, const cpumask_t *mask) { if( svc != NULL ) { - struct { + struct __packed { unsigned vcpu:16, dom:16; - unsigned cur_deadline_lo, cur_deadline_hi; - unsigned cur_budget_lo, cur_budget_hi; + uint64_t cur_deadline, cur_budget; } d; d.dom = svc->vcpu->domain->domain_id; d.vcpu = svc->vcpu->vcpu_id; - d.cur_deadline_lo = (unsigned) svc->cur_deadline; - d.cur_deadline_hi = (unsigned) (svc->cur_deadline >> 32); - d.cur_budget_lo = (unsigned) svc->cur_budget; - d.cur_budget_hi = (unsigned) (svc->cur_budget >> 32); + d.cur_deadline = (uint64_t) svc->cur_deadline; + d.cur_budget = (uint64_t) svc->cur_budget; trace_var(TRC_RTDS_RUNQ_PICK, 1, sizeof(d), (unsigned char *) &d);
such as deadline and budget. Packing is necessary to make it possible for xentrace_format to properly interpreet the records. Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com> --- Cc: George Dunlap <george.dunlap@eu.citrix.com> Cc: Meng Xu <mengxu@cis.upenn.edu> --- xen/common/sched_rt.c | 30 +++++++++++------------------- 1 file changed, 11 insertions(+), 19 deletions(-)