From patchwork Fri Feb 12 16:29:19 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Faggioli X-Patchwork-Id: 8293321 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id AE2589F399 for ; Fri, 12 Feb 2016 16:31:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D0993200E0 for ; Fri, 12 Feb 2016 16:31:50 +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 37A542021F for ; Fri, 12 Feb 2016 16:31:49 +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 1aUGaz-0007Fg-BP; Fri, 12 Feb 2016 16:29:25 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aUGax-0007FO-Fr for xen-devel@lists.xenproject.org; Fri, 12 Feb 2016 16:29:23 +0000 Received: from [85.158.137.68] by server-13.bemta-3.messagelabs.com id C0/6E-31443-2680EB65; Fri, 12 Feb 2016 16:29:22 +0000 X-Env-Sender: raistlin.df@gmail.com X-Msg-Ref: server-6.tower-31.messagelabs.com!1455294561!22048728!1 X-Originating-IP: [74.125.82.66] X-SpamReason: No, hits=0.2 required=7.0 tests=RCVD_ILLEGAL_IP, UPPERCASE_25_50 X-StarScan-Received: X-StarScan-Version: 7.35.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 47171 invoked from network); 12 Feb 2016 16:29:22 -0000 Received: from mail-wm0-f66.google.com (HELO mail-wm0-f66.google.com) (74.125.82.66) by server-6.tower-31.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 12 Feb 2016 16:29:22 -0000 Received: by mail-wm0-f66.google.com with SMTP id p63so3595555wmp.1 for ; Fri, 12 Feb 2016 08:29:22 -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=/3jZW5togwjlDRV5dc7pQKQwgzxDt5aGTIlhElg/D6U=; b=vrU/1S84q4OYh5eXrF0RYQss+z29CwgkQQhXzD9IsPPC6CPkcN56/+73SFHMe8ZrA9 wk4vZzgcSFlIRedjFUIaeFsJaJ11tO5Ju/TaCiXf7oQmBEoCS9GfzufC4YXt5oZmxVPK LufLVopNOG8auiIa4PnSTxzPZORFgGp79LxwEv2vMJeP4ClxCODWWer6EgCEOWTVBp77 /MGIU+aNHk9YdLG334HC+nfjfYvLmhUjMia1Fd2nJ9f/fT219nJfZ6zwPeg1BBOOeQ4/ YbT3xWLPWbovOu29wmkl3lpO6X8zlxhC0JhDfkdK0H2N5nz/32bXKoYssWn8taR+MbNd GPZA== 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=/3jZW5togwjlDRV5dc7pQKQwgzxDt5aGTIlhElg/D6U=; b=Z8c9Uc5L1lJ1RAE/VYUTqTMnTT8Fm14rxxHlpvVJ2HqvpVXM6EHYP4n7yYCLujhrla awDpByC4VrtJFif9S1OT30xU52TWQSAfUBnGxiMIJbXvRXYFQMO/TKJFfI1xMg33mkQU 85GbwfZCKzcOWuvcz6aBasEgf3/fZTJ9paI0G3QxMvHTPjTVj7pg8Lqw91iVAJdGsSSb Mlok5KEbnm8TpawdwDk30WnOjJIw3hQ5wexm7UvE92i3+k5vzqpUnV8VGUVSb2YodDXb rZsJSovV0MN5fNFEnr6oyRBzdmbH3uWNnKY/Fn8NYWkGW7td7SMtJS06ZHMvUCHcb2zP AmqQ== X-Gm-Message-State: AG10YOQ6ptNmvOgE5twQREcR3dD2fLrYke8g3QhO/YGiscEz+Ce/Lv1oiEeM3dN+61OZkw== X-Received: by 10.28.132.212 with SMTP id g203mr4006722wmd.30.1455294561794; Fri, 12 Feb 2016 08:29:21 -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 g126sm3053106wmf.16.2016.02.12.08.29.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Feb 2016 08:29:20 -0800 (PST) From: Dario Faggioli To: xen-devel@lists.xenproject.org Date: Fri, 12 Feb 2016 17:29:19 +0100 Message-ID: <20160212162919.25796.71218.stgit@Solace.station> In-Reply-To: <20160212162338.25796.17618.stgit@Solace.station> References: <20160212162338.25796.17618.stgit@Solace.station> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Cc: George Dunlap Subject: [Xen-devel] [PATCH v3 1/2] xen: credit1: trace vCPU boost/unboost 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 Add tracepoints and a performance counter for boosting and unboosting in Credit1. Note that they (the trace points) do not cover the case of the idle vCPU being boosted to run a tasklet, as there already is TRC_CSCHED_SCHED_TASKLET for that. Signed-off-by: Dario Faggioli Reviewed-by: George Dunlap --- Cc: George Dunlap --- xen/common/sched_credit.c | 8 ++++++++ xen/include/xen/perfc_defn.h | 1 + 2 files changed, 9 insertions(+) diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c index 671bbee..5708701 100644 --- a/xen/common/sched_credit.c +++ b/xen/common/sched_credit.c @@ -126,6 +126,8 @@ #define TRC_CSCHED_STOLEN_VCPU TRC_SCHED_CLASS_EVT(CSCHED, 4) #define TRC_CSCHED_PICKED_CPU TRC_SCHED_CLASS_EVT(CSCHED, 5) #define TRC_CSCHED_TICKLE TRC_SCHED_CLASS_EVT(CSCHED, 6) +#define TRC_CSCHED_BOOST_START TRC_SCHED_CLASS_EVT(CSCHED, 7) +#define TRC_CSCHED_BOOST_END TRC_SCHED_CLASS_EVT(CSCHED, 8) /* @@ -856,7 +858,11 @@ csched_vcpu_acct(struct csched_private *prv, unsigned int cpu) * amount of CPU resources and should no longer be boosted. */ if ( svc->pri == CSCHED_PRI_TS_BOOST ) + { svc->pri = CSCHED_PRI_TS_UNDER; + TRACE_2D(TRC_CSCHED_BOOST_END, svc->sdom->dom->domain_id, + svc->vcpu->vcpu_id); + } /* * Update credits @@ -1023,6 +1029,8 @@ csched_vcpu_wake(const struct scheduler *ops, struct vcpu *vc) if ( svc->pri == CSCHED_PRI_TS_UNDER && !test_bit(CSCHED_FLAG_VCPU_PARKED, &svc->flags) ) { + TRACE_2D(TRC_CSCHED_BOOST_START, vc->domain->domain_id, vc->vcpu_id); + SCHED_STAT_CRANK(vcpu_boost); svc->pri = CSCHED_PRI_TS_BOOST; } diff --git a/xen/include/xen/perfc_defn.h b/xen/include/xen/perfc_defn.h index 76ee803..21c1e0b 100644 --- a/xen/include/xen/perfc_defn.h +++ b/xen/include/xen/perfc_defn.h @@ -40,6 +40,7 @@ PERFCOUNTER(acct_reorder, "csched: acct_reorder") PERFCOUNTER(acct_min_credit, "csched: acct_min_credit") PERFCOUNTER(acct_vcpu_active, "csched: acct_vcpu_active") PERFCOUNTER(acct_vcpu_idle, "csched: acct_vcpu_idle") +PERFCOUNTER(vcpu_boost, "csched: vcpu_boost") PERFCOUNTER(vcpu_park, "csched: vcpu_park") PERFCOUNTER(vcpu_unpark, "csched: vcpu_unpark") PERFCOUNTER(load_balance_idle, "csched: load_balance_idle")