From patchwork Fri Feb 7 07:24:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?SsO8cmdlbiBHcm/Dnw==?= X-Patchwork-Id: 11369885 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D0FA614B4 for ; Fri, 7 Feb 2020 07:26:43 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B67DE2082E for ; Fri, 7 Feb 2020 07:26:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B67DE2082E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1izxzo-0007I8-K7; Fri, 07 Feb 2020 07:24:12 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1izxzn-0007I3-0B for xen-devel@lists.xenproject.org; Fri, 07 Feb 2020 07:24:11 +0000 X-Inumbo-ID: d45dfdde-497a-11ea-b2cb-bc764e2007e4 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id d45dfdde-497a-11ea-b2cb-bc764e2007e4; Fri, 07 Feb 2020 07:24:09 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 07443AFC6; Fri, 7 Feb 2020 07:24:07 +0000 (UTC) From: Juergen Gross To: xen-devel@lists.xenproject.org Date: Fri, 7 Feb 2020 08:24:05 +0100 Message-Id: <20200207072405.2236-1-jgross@suse.com> X-Mailer: git-send-email 2.16.4 Subject: [Xen-devel] [PATCH] 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 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. Signed-off-by: Juergen Gross --- xen/common/sched/core.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/xen/common/sched/core.c b/xen/common/sched/core.c index d4e8944e0e..103d94bd02 100644 --- a/xen/common/sched/core.c +++ b/xen/common/sched/core.c @@ -3235,7 +3235,7 @@ void scheduler_free(struct scheduler *sched) void schedule_dump(struct cpupool *c) { - unsigned int i; + unsigned int i, j; struct scheduler *sched; cpumask_t *cpus; @@ -3246,7 +3246,7 @@ void schedule_dump(struct cpupool *c) if ( c != NULL ) { sched = c->sched; - cpus = c->cpu_valid; + cpus = c->res_valid; printk("Scheduler: %s (%s)\n", sched->name, sched->opt_name); sched_dump_settings(sched); } @@ -3256,11 +3256,18 @@ void schedule_dump(struct cpupool *c) cpus = &cpupool_free_cpus; } - if ( sched->dump_cpu_state != 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 = get_sched_res(i); + + printk("CPU[%02d] current=%pv, curr=%pv, prev=%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 != j ) + printk("CPU[%02d] current=%pv\n", j, get_cpu_current(j)); + sched_dump_cpu_state(sched, i); } rcu_read_unlock(&sched_res_rculock);