From nobody Fri Apr 26 12:06:20 2024 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1581424107302185.88334258423617; Tue, 11 Feb 2020 04:28:27 -0800 (PST) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1j1Udh-0006qD-H1; Tue, 11 Feb 2020 12:27:41 +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 1j1Udf-0006q8-Sd for xen-devel@lists.xenproject.org; Tue, 11 Feb 2020 12:27:39 +0000 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id e3cbdb0f-4cc9-11ea-b583-12813bfff9fa; Tue, 11 Feb 2020 12:27:39 +0000 (UTC) Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 2392EAEAC; Tue, 11 Feb 2020 12:27:38 +0000 (UTC) X-Inumbo-ID: e3cbdb0f-4cc9-11ea-b583-12813bfff9fa X-Virus-Scanned: by amavisd-new at test-mx.suse.de From: Juergen Gross To: xen-devel@lists.xenproject.org Date: Tue, 11 Feb 2020 13:27:36 +0100 Message-Id: <20200211122736.16714-1-jgross@suse.com> X-Mailer: git-send-email 2.16.4 Subject: [Xen-devel] [PATCH v2] xen/sched: add some diagnostic info in the run queue keyhandler 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 , George Dunlap , Dario Faggioli MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" When dumping the run queue information add some more data regarding current and (if known) previous vcpu for each physical cpu. With core scheduling activated the printed data will be e.g.: (XEN) CPUs info: (XEN) CPU[00] current=3Dd[IDLE]v0, curr=3Dd[IDLE]v0, prev=3DNULL (XEN) CPU[01] current=3Dd[IDLE]v1 (XEN) CPU[02] current=3Dd[IDLE]v2, curr=3Dd[IDLE]v2, prev=3DNULL (XEN) CPU[03] current=3Dd[IDLE]v3 Signed-off-by: Juergen Gross Reviewed-by: Dario Faggioli --- V2: add proper locking --- xen/common/sched/core.c | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/xen/common/sched/core.c b/xen/common/sched/core.c index 2e43f8029f..6fbc30e678 100644 --- a/xen/common/sched/core.c +++ b/xen/common/sched/core.c @@ -3234,7 +3234,7 @@ void scheduler_free(struct scheduler *sched) =20 void schedule_dump(struct cpupool *c) { - unsigned int i; + unsigned int i, j; struct scheduler *sched; cpumask_t *cpus; =20 @@ -3245,7 +3245,7 @@ void schedule_dump(struct cpupool *c) if ( c !=3D NULL ) { sched =3D c->sched; - cpus =3D c->cpu_valid; + cpus =3D c->res_valid; printk("Scheduler: %s (%s)\n", sched->name, sched->opt_name); sched_dump_settings(sched); } @@ -3255,11 +3255,25 @@ void schedule_dump(struct cpupool *c) cpus =3D &cpupool_free_cpus; } =20 - if ( sched->dump_cpu_state !=3D NULL ) + printk("CPUs info:\n"); + for_each_cpu (i, cpus) { - printk("CPUs info:\n"); - for_each_cpu (i, cpus) - sched_dump_cpu_state(sched, i); + struct sched_resource *sr =3D get_sched_res(i); + unsigned long flags; + spinlock_t *lock; + + lock =3D pcpu_schedule_lock_irqsave(i, &flags); + + printk("CPU[%02d] current=3D%pv, curr=3D%pv, prev=3D%pv\n", i, + get_cpu_current(i), sr->curr ? sr->curr->vcpu_list : NULL, + sr->prev ? sr->prev->vcpu_list : NULL); + for_each_cpu (j, sr->cpus) + if ( i !=3D j ) + printk("CPU[%02d] current=3D%pv\n", j, get_cpu_current(j)); + + pcpu_schedule_unlock_irqrestore(lock, flags, i); + + sched_dump_cpu_state(sched, i); } =20 rcu_read_unlock(&sched_res_rculock); --=20 2.16.4 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel