From patchwork Fri Jun 17 23:11:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Faggioli X-Patchwork-Id: 9185129 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E3EA4601C0 for ; Fri, 17 Jun 2016 23:13:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D2B99200E7 for ; Fri, 17 Jun 2016 23:13:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C712327F07; Fri, 17 Jun 2016 23:13:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3BC5B200E7 for ; Fri, 17 Jun 2016 23:13:25 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bE2vI-00030Q-5i; Fri, 17 Jun 2016 23:11:36 +0000 Received: from mail6.bemta6.messagelabs.com ([85.158.143.247]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bE2vG-000302-8L for xen-devel@lists.xenproject.org; Fri, 17 Jun 2016 23:11:34 +0000 Received: from [85.158.143.35] by server-2.bemta-6.messagelabs.com id 73/B6-11548-5A384675; Fri, 17 Jun 2016 23:11:33 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrEIsWRWlGSWpSXmKPExsXiVRvkpLukOSX c4N5lE4vvWyYzOTB6HP5whSWAMYo1My8pvyKBNePSSr2CT/oVW+6vZGlg3K/SxcjFISQwg1Hi xua5bCAOi8AaVonrsx4ygjgSApdYJY6/mgDkcAI5MRLtf2cxQdiVEr9P9bKB2EICKhI3t69ig hi1kEni3pkmsISwgJ7EkaM/2CFsL4kTh3Yzg9hsAgYSb3bsZQWxRQSUJO6tmgzWzCywgFHibj NEEYuAqkTn6pNgzbwCPhL3/n8F28wp4Cux+souqM0+EhfPPQKzRQXkJFZebmGFqBeUODnzCUs XIwfQUE2J9bv0QcLMAvIS29/OYZ7AKDILSdUshKpZSKoWMDKvYlQvTi0qSy3SNdRLKspMzyjJ TczM0TU0MNPLTS0uTkxPzUlMKtZLzs/dxAgMfwYg2MG487nTIUZJDiYlUd4rlSnhQnxJ+SmVG YnFGfFFpTmpxYcYZTg4lCR4DZqAcoJFqempFWmZOcBIhElLcPAoifBWgaR5iwsSc4sz0yFSpx h1ObZMvbeWSYglLz8vVUqcVxOkSACkKKM0D24ELClcYpSVEuZlBDpKiKcgtSg3swRV/hWjOAe jkjBvJMgUnsy8ErhNr4COYAI6QnNeMsgRJYkIKakGxolfjGdqFyiGrH+ymMdJXcbN9afE/Hv6 7z0En/kk5H5XdjD+vf2lfMyetouKicq9B68dP3WgYVv4bYsjC26+zNnGG3STt/2y57nuD9Imo R5TgjaHdTH0Shn36Z19qJnMXa4iFsV8qf/SB0b+C+Xc/i8zs9d9KK77kuqemZDDuZNHhC3VWl FRiaU4I9FQi7moOBEAgzinNwUDAAA= X-Env-Sender: raistlin.df@gmail.com X-Msg-Ref: server-12.tower-21.messagelabs.com!1466205092!19652526!1 X-Originating-IP: [74.125.82.66] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 8.46; banners=-,-,- X-VirusChecked: Checked Received: (qmail 41357 invoked from network); 17 Jun 2016 23:11:32 -0000 Received: from mail-wm0-f66.google.com (HELO mail-wm0-f66.google.com) (74.125.82.66) by server-12.tower-21.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 17 Jun 2016 23:11:32 -0000 Received: by mail-wm0-f66.google.com with SMTP id m124so1073541wme.3 for ; Fri, 17 Jun 2016 16:11:32 -0700 (PDT) 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-transfer-encoding; bh=A/p4PVmzeJRxtN2aHKa6lL2sGqr6+m8UPAE4x2xIPTE=; b=Fk400IKIjuvlfIO6Z/LtXMvBeLyxgVv6U2tPW8YWt5iaO4NUIxmEu9PJN24ME6A7Ur 2gFQlx4OEfef7XEwlG9IG+ttaS9ffQo3KIgfrlF7oEP4rwobDOxPPD/JEHooxLhn71G7 6Rac5NLJe2tOp5lNYOPCVSgjTsJHh+VY8KN92F1SL4WxvlXN3xAZ73YMQQFNBha3ZVxN lD5q1YAu6gsiWUmvKNyCwVU5N0zs+1A3oYsHK6mWgalysVq9xLb95YEwwy8QTBHpe1Kv tUkKGcyMUcb+4r1E6FizGaYGnxE8GfvWfzQN50YXdHcAZruVd1y6ZF5QAGNoE6SoCFek Wrcg== 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-transfer-encoding; bh=A/p4PVmzeJRxtN2aHKa6lL2sGqr6+m8UPAE4x2xIPTE=; b=ODR0xrzjAdeWsO87k6GPGVbcBWLF9rXNEZ45LenLnIzkWTfAtUZLfc2DIqQw54fINc h+Xe5IXNJo+5zTEwxXKv/xTGtySPCbTfsnLFWo00z55kbwUDHSsbN4E5DVJR6RZBFrUd pVMT6gclEBnNHYFPi8DDtO6UrcYKSOHEmqEJ1p/RJo9UF7Fwtj8SkfsfQE3LLxCShCuq OwOM5rud7+105aExZuZl4KKTmvbwtDtLDtz8rQbUY9G5s2hKphkPBbkytoNREdlJGcbO dXE9P7x1YH3/yhWXIXxrxUjx8sxAGN5yE3GoKyvY+ZABVBEU/LvBH0iy2lB/zicC3HTB yrjQ== X-Gm-Message-State: ALyK8tKmJlaxzW2v6Q+hE9xPr4VK9kUlsqIYTXTtKN1CjMcQ1RsjnZ7L8m7nNSG2k0EGgA== X-Received: by 10.28.142.144 with SMTP id q138mr713842wmd.30.1466205092371; Fri, 17 Jun 2016 16:11:32 -0700 (PDT) Received: from Solace.fritz.box (net-93-65-149-191.cust.vodafonedsl.it. [93.65.149.191]) by smtp.gmail.com with ESMTPSA id a198sm840491wme.16.2016.06.17.16.11.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Jun 2016 16:11:31 -0700 (PDT) From: Dario Faggioli To: xen-devel@lists.xenproject.org Date: Sat, 18 Jun 2016 01:11:29 +0200 Message-ID: <146620508969.29766.13969894361864989281.stgit@Solace.fritz.box> In-Reply-To: <146620492155.29766.10321123657058307698.stgit@Solace.fritz.box> References: <146620492155.29766.10321123657058307698.stgit@Solace.fritz.box> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Cc: Anshul Makkar , Meng Xu , George Dunlap , David Vrabel Subject: [Xen-devel] [PATCH 02/19] xen: sched: make the 'tickled' perf counter clearer X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP In fact, what we have right now, i.e., tickle_idlers_none and tickle_idlers_some, is not good enough for describing what really happens in the various tickling functions of the various scheduler. Switch to a more descriptive set of counters, such as: - tickled_no_cpu: for when we don't tickle anyone - tickled_idle_cpu: for when we tickle one or more idler - tickled_busy_cpu: for when we tickle one or more non-idler While there, fix style of an "out:" label in sched_rt.c. Signed-off-by: Dario Faggioli Reviewed-by: Meng Xu Acked-by: George Dunlap --- Cc: George Dunlap Cc: Meng Xu Cc: Anshul Makkar Cc: David Vrabel --- xen/common/sched_credit.c | 10 +++++++--- xen/common/sched_credit2.c | 12 +++++------- xen/common/sched_rt.c | 8 +++++--- xen/include/xen/perfc_defn.h | 5 +++-- 4 files changed, 20 insertions(+), 15 deletions(-) diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c index a6645a2..a54bb2d 100644 --- a/xen/common/sched_credit.c +++ b/xen/common/sched_credit.c @@ -385,7 +385,9 @@ static inline void __runq_tickle(struct csched_vcpu *new) || (idlers_empty && new->pri > cur->pri) ) { if ( cur->pri != CSCHED_PRI_IDLE ) - SCHED_STAT_CRANK(tickle_idlers_none); + SCHED_STAT_CRANK(tickled_busy_cpu); + else + SCHED_STAT_CRANK(tickled_idle_cpu); __cpumask_set_cpu(cpu, &mask); } else if ( !idlers_empty ) @@ -444,13 +446,13 @@ static inline void __runq_tickle(struct csched_vcpu *new) set_bit(_VPF_migrating, &cur->vcpu->pause_flags); } /* Tickle cpu anyway, to let new preempt cur. */ - SCHED_STAT_CRANK(tickle_idlers_none); + SCHED_STAT_CRANK(tickled_busy_cpu); __cpumask_set_cpu(cpu, &mask); } else if ( !new_idlers_empty ) { /* Which of the idlers suitable for new shall we wake up? */ - SCHED_STAT_CRANK(tickle_idlers_some); + SCHED_STAT_CRANK(tickled_idle_cpu); if ( opt_tickle_one_idle ) { this_cpu(last_tickle_cpu) = @@ -479,6 +481,8 @@ static inline void __runq_tickle(struct csched_vcpu *new) /* Send scheduler interrupts to designated CPUs */ cpumask_raise_softirq(&mask, SCHEDULE_SOFTIRQ); } + else + SCHED_STAT_CRANK(tickled_no_cpu); } static void diff --git a/xen/common/sched_credit2.c b/xen/common/sched_credit2.c index cf8455c..0246453 100644 --- a/xen/common/sched_credit2.c +++ b/xen/common/sched_credit2.c @@ -589,6 +589,7 @@ runq_tickle(const struct scheduler *ops, unsigned int cpu, struct csched2_vcpu * i = cpumask_cycle(cpu, &mask); if ( i < nr_cpu_ids ) { + SCHED_STAT_CRANK(tickled_idle_cpu); ipid = i; goto tickle; } @@ -637,11 +638,12 @@ runq_tickle(const struct scheduler *ops, unsigned int cpu, struct csched2_vcpu * * than the migrate resistance */ if ( ipid == -1 || lowest + CSCHED2_MIGRATE_RESIST > new->credit ) { - SCHED_STAT_CRANK(tickle_idlers_none); - goto no_tickle; + SCHED_STAT_CRANK(tickled_no_cpu); + return; } -tickle: + SCHED_STAT_CRANK(tickled_busy_cpu); + tickle: BUG_ON(ipid == -1); /* TRACE */ { @@ -654,11 +656,7 @@ tickle: (unsigned char *)&d); } cpumask_set_cpu(ipid, &rqd->tickled); - SCHED_STAT_CRANK(tickle_idlers_some); cpu_raise_softirq(ipid, SCHEDULE_SOFTIRQ); - -no_tickle: - return; } /* diff --git a/xen/common/sched_rt.c b/xen/common/sched_rt.c index 5b077d7..dd1c4d3 100644 --- a/xen/common/sched_rt.c +++ b/xen/common/sched_rt.c @@ -1140,6 +1140,7 @@ runq_tickle(const struct scheduler *ops, struct rt_vcpu *new) /* 1) if new's previous cpu is idle, kick it for cache benefit */ if ( is_idle_vcpu(curr_on_cpu(new->vcpu->processor)) ) { + SCHED_STAT_CRANK(tickled_idle_cpu); cpu_to_tickle = new->vcpu->processor; goto out; } @@ -1151,6 +1152,7 @@ runq_tickle(const struct scheduler *ops, struct rt_vcpu *new) iter_vc = curr_on_cpu(cpu); if ( is_idle_vcpu(iter_vc) ) { + SCHED_STAT_CRANK(tickled_idle_cpu); cpu_to_tickle = cpu; goto out; } @@ -1164,14 +1166,15 @@ runq_tickle(const struct scheduler *ops, struct rt_vcpu *new) if ( latest_deadline_vcpu != NULL && new->cur_deadline < latest_deadline_vcpu->cur_deadline ) { + SCHED_STAT_CRANK(tickled_busy_cpu); cpu_to_tickle = latest_deadline_vcpu->vcpu->processor; goto out; } /* didn't tickle any cpu */ - SCHED_STAT_CRANK(tickle_idlers_none); + SCHED_STAT_CRANK(tickled_no_cpu); return; -out: + out: /* TRACE */ { struct { @@ -1185,7 +1188,6 @@ out: } cpumask_set_cpu(cpu_to_tickle, &prv->tickled); - SCHED_STAT_CRANK(tickle_idlers_some); cpu_raise_softirq(cpu_to_tickle, SCHEDULE_SOFTIRQ); return; } diff --git a/xen/include/xen/perfc_defn.h b/xen/include/xen/perfc_defn.h index 21c1e0b..a336c71 100644 --- a/xen/include/xen/perfc_defn.h +++ b/xen/include/xen/perfc_defn.h @@ -27,8 +27,9 @@ PERFCOUNTER(vcpu_wake_running, "sched: vcpu_wake_running") PERFCOUNTER(vcpu_wake_onrunq, "sched: vcpu_wake_onrunq") PERFCOUNTER(vcpu_wake_runnable, "sched: vcpu_wake_runnable") PERFCOUNTER(vcpu_wake_not_runnable, "sched: vcpu_wake_not_runnable") -PERFCOUNTER(tickle_idlers_none, "sched: tickle_idlers_none") -PERFCOUNTER(tickle_idlers_some, "sched: tickle_idlers_some") +PERFCOUNTER(tickled_no_cpu, "sched: tickled_no_cpu") +PERFCOUNTER(tickled_idle_cpu, "sched: tickled_idle_cpu") +PERFCOUNTER(tickled_busy_cpu, "sched: tickled_busy_cpu") PERFCOUNTER(vcpu_check, "sched: vcpu_check") /* credit specific counters */