From mboxrd@z Thu Jan 1 00:00:00 1970 From: George Dunlap Subject: Re: [PATCH v2 02/16] xen: sched: move up the trace record for vcpu_wake and vcpu_sleep Date: Thu, 18 Feb 2016 10:34:59 +0000 Message-ID: <56C59E53.7070600@citrix.com> References: <20160216180550.27876.22680.stgit@Solace.station> <20160216181121.27876.65964.stgit@Solace.station> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aWLvL-0006WT-VI for xen-devel@lists.xenproject.org; Thu, 18 Feb 2016 10:35:04 +0000 In-Reply-To: <20160216181121.27876.65964.stgit@Solace.station> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Dario Faggioli , xen-devel@lists.xenproject.org List-Id: xen-devel@lists.xenproject.org On 16/02/16 18:11, Dario Faggioli wrote: > vcpu_wake() and vcpu_sleep() are called before the specific > schedulers wakeup and sleep routines (in fact, it is them > that calls those specific routine). > > Make the trace reflect that, by moving the records up. In > fact, it is more natural and easy to find the record of > the event (e.g., the wakeup) *before* the records of the > actions that deals with the event itself. > > Signed-off-by: Dario Faggioli > Reviewed-by: Konrad Rzeszutek Wilk Acked-by: George Dunlap > --- > Cc: George Dunlap > --- > xen/common/schedule.c | 16 ++++++++++------ > 1 file changed, 10 insertions(+), 6 deletions(-) > > diff --git a/xen/common/schedule.c b/xen/common/schedule.c > index 7306d71..c87922f 100644 > --- a/xen/common/schedule.c > +++ b/xen/common/schedule.c > @@ -381,7 +381,11 @@ void sched_destroy_domain(struct domain *d) > void vcpu_sleep_nosync(struct vcpu *v) > { > unsigned long flags; > - spinlock_t *lock = vcpu_schedule_lock_irqsave(v, &flags); > + spinlock_t *lock; > + > + TRACE_2D(TRC_SCHED_SLEEP, v->domain->domain_id, v->vcpu_id); > + > + lock = vcpu_schedule_lock_irqsave(v, &flags); > > if ( likely(!vcpu_runnable(v)) ) > { > @@ -392,8 +396,6 @@ void vcpu_sleep_nosync(struct vcpu *v) > } > > vcpu_schedule_unlock_irqrestore(lock, flags, v); > - > - TRACE_2D(TRC_SCHED_SLEEP, v->domain->domain_id, v->vcpu_id); > } > > void vcpu_sleep_sync(struct vcpu *v) > @@ -409,7 +411,11 @@ void vcpu_sleep_sync(struct vcpu *v) > void vcpu_wake(struct vcpu *v) > { > unsigned long flags; > - spinlock_t *lock = vcpu_schedule_lock_irqsave(v, &flags); > + spinlock_t *lock; > + > + TRACE_2D(TRC_SCHED_WAKE, v->domain->domain_id, v->vcpu_id); > + > + lock = vcpu_schedule_lock_irqsave(v, &flags); > > if ( likely(vcpu_runnable(v)) ) > { > @@ -424,8 +430,6 @@ void vcpu_wake(struct vcpu *v) > } > > vcpu_schedule_unlock_irqrestore(lock, flags, v); > - > - TRACE_2D(TRC_SCHED_WAKE, v->domain->domain_id, v->vcpu_id); > } > > void vcpu_unblock(struct vcpu *v) >