From nobody Fri May 3 22:28:06 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1587026063; cv=none; d=zohomail.com; s=zohoarc; b=mP0/EwV8nl+w8HjvXwkEEL7RswpS34jZy2HTQsGSEGgIpsd28m2Epx8tSW1xjRXNmblJw5TznBKNswFR1GzJSp3axTXf52nKsAHARnyv6DAl/TSVKG1ni+29+09iwV4ZIuqDJGafY7unucPbihTUu5SKu5hETDfXUpmaOuUZOWk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587026063; h=Content-Type:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=k5Cpx9nOwCoYdKp0+LRPymgqlfkP8VJB4lQ39x20XBU=; b=JwXkX3TN8h372N13NksW2c6sgvZ00dipi/z9Hb3W6vHu3VOyEQKCYDxM0bOYOGD3VJY0F0JSm/Y5s0tyyd/7fmyp/5ABdKMB4jEUzTIcv+4I+gWuwusfq51PIuzVuAgT8R3PEcTslwt/7/Fxt5S/whMUP9bz3yjnYj1sGJfCovk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1587026063610317.2365790833138; Thu, 16 Apr 2020 01:34:23 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1jOzyC-0007RL-7v; Thu, 16 Apr 2020 08:34:00 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1jOzyA-0007RG-EN for xen-devel@lists.xenproject.org; Thu, 16 Apr 2020 08:33:58 +0000 Received: from esa2.hc3370-68.iphmx.com (unknown [216.71.145.153]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 029ead9c-7fbd-11ea-8b65-12813bfff9fa; Thu, 16 Apr 2020 08:33:56 +0000 (UTC) X-Inumbo-ID: 029ead9c-7fbd-11ea-8b65-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1587026037; h=from:to:cc:subject:date:message-id:mime-version; bh=NgXOvquez9U/cttLx9tqkxe4NTlWEYntfETsT8qIthM=; b=YroKZK1GiHIPkdz9zNq6WdqKdZzvKWCGXg9zMBAKSVbw1rffsmG1atEs 96nzUmoBLjCaw0sQnngC0XgoUIp3Pn65Db8wyxjOjjxA3N9VMIDqeyWf2 9WB8T6CfqBS7TIrMRh9DzbNTyWxW5klkWrGcR35kXPB42mR36p1qckvSc o=; Authentication-Results: esa2.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=sergey.dyasli@citrix.com; spf=Pass smtp.mailfrom=sergey.dyasli@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: None (esa2.hc3370-68.iphmx.com: no sender authenticity information available from domain of sergey.dyasli@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="sergey.dyasli@citrix.com"; x-sender="sergey.dyasli@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa2.hc3370-68.iphmx.com: domain of sergey.dyasli@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="sergey.dyasli@citrix.com"; x-sender="sergey.dyasli@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ip4:168.245.78.127 ~all" Received-SPF: None (esa2.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="sergey.dyasli@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: u2M5NzuNL1QYGylOCtwnH8eWYCiSA4I8BdR2hGXE8UawawyirMNLVcgCwgCYEij9X4ENyh/7mT YQVo0aq4bUOpV+nfZ9Zb6MZS4wmvurkzF0hw9TYoueR6C9enRLaBQVwybobd9jE6ockvyve5PU T3tMcTW7iZ/tcgj4kCgR8+EdwgJOZL58eDP55EbKZpUw+4upqDhfy4Q4Y8cfpYVvqzbGH4UYez cikYAnCSvtcHpRYq39BvQwjwjbbXePPjm/IZ+UdqZ4t7fw3Xp48E3IzwX3Jv6Wpes5DNynLwtE Kc8= X-SBRS: 2.7 X-MesageID: 15778273 X-Ironport-Server: esa2.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.72,390,1580792400"; d="scan'208";a="15778273" From: Sergey Dyasli To: Subject: [PATCH] sched: print information about scheduler granularity Date: Thu, 16 Apr 2020 09:33:41 +0100 Message-ID: <20200416083341.21122-1-sergey.dyasli@citrix.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Juergen Gross , Sergey Dyasli , George Dunlap , Jan Beulich , Dario Faggioli Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Currently it might be not obvious which scheduling mode is being used by the scheduler. Alleviate this by printing additional information about the selected granularity. Messages now look like these: 1. boot (XEN) [00089808f0ea7496] Using scheduler: SMP Credit Scheduler (credit) in = core-scheduling mode 2. xl debug-keys r (XEN) [ 45.914314] Scheduler: SMP Credit Scheduler (credit) in 2-way core= -scheduling mode Signed-off-by: Sergey Dyasli --- CC: Juergen Gross CC: Dario Faggioli CC: George Dunlap CC: Jan Beulich --- xen/common/sched/core.c | 10 ++++++++-- xen/common/sched/cpupool.c | 30 +++++++++++++++++++++++++++++- xen/common/sched/private.h | 2 ++ 3 files changed, 39 insertions(+), 3 deletions(-) diff --git a/xen/common/sched/core.c b/xen/common/sched/core.c index d4a6489929..b1b09a159b 100644 --- a/xen/common/sched/core.c +++ b/xen/common/sched/core.c @@ -2883,6 +2883,7 @@ void scheduler_enable(void) void __init scheduler_init(void) { struct domain *idle_domain; + char sched_gran[20]; int i; =20 scheduler_enable(); @@ -2937,7 +2938,9 @@ void __init scheduler_init(void) BUG(); register_cpu_notifier(&cpu_schedule_nfb); =20 - printk("Using scheduler: %s (%s)\n", ops.name, ops.opt_name); + printk("Using scheduler: %s (%s) in %s-scheduling mode\n", + ops.name, ops.opt_name, + sched_gran_str(sched_gran, sizeof(sched_gran))); if ( sched_init(&ops) ) panic("scheduler returned error on init\n"); =20 @@ -3267,6 +3270,7 @@ void schedule_dump(struct cpupool *c) unsigned int i, j; struct scheduler *sched; cpumask_t *cpus; + char sched_gran[20]; =20 /* Locking, if necessary, must be handled withing each scheduler */ =20 @@ -3276,7 +3280,9 @@ void schedule_dump(struct cpupool *c) { sched =3D c->sched; cpus =3D c->res_valid; - printk("Scheduler: %s (%s)\n", sched->name, sched->opt_name); + printk("Scheduler: %s (%s) in %s-scheduling mode\n", + sched->name, sched->opt_name, + sched_gran_str(sched_gran, sizeof(sched_gran))); sched_dump_settings(sched); } else diff --git a/xen/common/sched/cpupool.c b/xen/common/sched/cpupool.c index d40345b585..a37b97f4c2 100644 --- a/xen/common/sched/cpupool.c +++ b/xen/common/sched/cpupool.c @@ -38,7 +38,35 @@ static cpumask_t cpupool_locked_cpus; static DEFINE_SPINLOCK(cpupool_lock); =20 static enum sched_gran __read_mostly opt_sched_granularity =3D SCHED_GRAN_= cpu; -static unsigned int __read_mostly sched_granularity =3D 1; +static unsigned int __read_mostly sched_granularity; + +char *sched_gran_str(char *str, size_t size) +{ + char *mode =3D ""; + + switch ( opt_sched_granularity ) + { + case SCHED_GRAN_cpu: + mode =3D "cpu"; + break; + case SCHED_GRAN_core: + mode =3D "core"; + break; + case SCHED_GRAN_socket: + mode =3D "socket"; + break; + default: + ASSERT_UNREACHABLE(); + break; + } + + if ( sched_granularity ) + snprintf(str, size, "%u-way %s", sched_granularity, mode); + else + snprintf(str, size, "%s", mode); + + return str; +} =20 #ifdef CONFIG_HAS_SCHED_GRANULARITY static int __init sched_select_granularity(const char *str) diff --git a/xen/common/sched/private.h b/xen/common/sched/private.h index 367811a12f..fd49f545cb 100644 --- a/xen/common/sched/private.h +++ b/xen/common/sched/private.h @@ -30,6 +30,8 @@ enum sched_gran { SCHED_GRAN_socket }; =20 +char *sched_gran_str(char *str, size_t size); + /* * In order to allow a scheduler to remap the lock->cpu mapping, * we have a per-cpu pointer, along with a pre-allocated set of --=20 2.17.1