From patchwork Tue Feb 16 18:11:21 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Faggioli X-Patchwork-Id: 8330461 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 39394C02AA for ; Tue, 16 Feb 2016 18:14:04 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 42DCB202AE for ; Tue, 16 Feb 2016 18:14:03 +0000 (UTC) Received: from lists.xen.org (lists.xenproject.org [50.57.142.19]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4FA6820295 for ; Tue, 16 Feb 2016 18:14:02 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aVk5u-0003Gp-HV; Tue, 16 Feb 2016 18:11:26 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aVk5t-0003Ga-AA for xen-devel@lists.xenproject.org; Tue, 16 Feb 2016 18:11:25 +0000 Received: from [85.158.139.211] by server-14.bemta-5.messagelabs.com id 1F/E7-18633-C4663C65; Tue, 16 Feb 2016 18:11:24 +0000 X-Env-Sender: raistlin.df@gmail.com X-Msg-Ref: server-10.tower-206.messagelabs.com!1455646284!22810200!1 X-Originating-IP: [74.125.82.68] X-SpamReason: No, hits=0.2 required=7.0 tests=RCVD_ILLEGAL_IP X-StarScan-Received: X-StarScan-Version: 7.35.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 50361 invoked from network); 16 Feb 2016 18:11:24 -0000 Received: from mail-wm0-f68.google.com (HELO mail-wm0-f68.google.com) (74.125.82.68) by server-10.tower-206.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 16 Feb 2016 18:11:24 -0000 Received: by mail-wm0-f68.google.com with SMTP id a4so16748194wme.3 for ; Tue, 16 Feb 2016 10:11:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:from:to:cc:date:message-id:in-reply-to:references :user-agent:mime-version:content-type:content-transfer-encoding; bh=/XgrvbjR7GvJ1bjUTysFD4UTvN7mkO2FoQ94BVXoHSw=; b=T1HyF8RVTmOQ9LeJNoUGQN+aiqjfgAJIBQFeBmKn5Jo0Ku8DL8+6xAVDYpzxM6Ab1I qJyvbgD7Tbw6kTQQWeibPKMKHuq43LWC57gGAQbkFkJLfqYy2YPHaU+clt5tTTyisfIX Vc72YhD6QhP0IKxdL7qhyQNXYsiYEHiXoHWB9L6ydqxwQROA6K7ml3zVGZGnjkGlDwPy wQqru91pkcQD7u0KlUWnYcJpDjpf7J49k4aAW/hr2Sc+GyGAEjVIlrIs364m4SyDeyCA lvfIKFCmywYDO8fZoBs+9sTtSVhHX+h5mSbUa7HukJoOJhbyb21exAMCqkd9sMT/bWWC S61Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:from:to:cc:date:message-id :in-reply-to:references:user-agent:mime-version:content-type :content-transfer-encoding; bh=/XgrvbjR7GvJ1bjUTysFD4UTvN7mkO2FoQ94BVXoHSw=; b=H60lpM0mInZ2y34xhg4y5t/ybP/KLDEXD1YRx4H7JWN7kjTs+mZovuL02e4ytMd1PZ VwcCHxKgHSoeZV9khN8RjC+zxqnvpIcdiBAJrH6qNBaGoxTikQgLg0rIFIo1MfE1RmfR KyU7TedlJkBJpjjaiwYYdVjVa0FXv4YE12OYm6STBJ1tJWMKfib/089nEpwO1KcVQ7Sc 0xxqUqE5ePjHIqSW4VT64FHiFFFwoKnFrohGJCMglvwyEVuzVmGnclUzxKuO1LpWzetZ 4p3LE8wWhAXwG7II8QUN4LSLBjv/65NNvR3YLuJ2slIvZGae6CC21ERx7R/fRk2zpHS3 nCRg== X-Gm-Message-State: AG10YOQHMWBccZ3trCXLhj9/Dx5fteNJpThnHsky8Z+csTBSSEsB75ilHphHuCJ9W/ScIw== X-Received: by 10.194.185.180 with SMTP id fd20mr25601682wjc.98.1455646283907; Tue, 16 Feb 2016 10:11:23 -0800 (PST) Received: from Solace.station (net-2-35-170-8.cust.vodafonedsl.it. [2.35.170.8]) by smtp.gmail.com with ESMTPSA id jo6sm31360839wjb.48.2016.02.16.10.11.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Feb 2016 10:11:23 -0800 (PST) From: Dario Faggioli To: xen-devel@lists.xenproject.org Date: Tue, 16 Feb 2016 19:11:21 +0100 Message-ID: <20160216181121.27876.65964.stgit@Solace.station> In-Reply-To: <20160216180550.27876.22680.stgit@Solace.station> References: <20160216180550.27876.22680.stgit@Solace.station> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Cc: George Dunlap Subject: [Xen-devel] [PATCH v2 02/16] xen: sched: move up the trace record for vcpu_wake and vcpu_sleep X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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)