[for-4.13] xen/sched: Render sibling/core masks with %pbl to improve 'r' debugkey
diff mbox series

Message ID 20191113183641.2871-1-andrew.cooper3@citrix.com
State New
Headers show
Series
  • [for-4.13] xen/sched: Render sibling/core masks with %pbl to improve 'r' debugkey
Related show

Commit Message

Andrew Cooper Nov. 13, 2019, 6:36 p.m. UTC
For system with large numbers of CPUs, the 'r' debugkey is unwieldy.  Sibling
and core masks are a single block of adjacent bits, so are vastly shorter to
render with %pbl.

Before:
  (XEN) CPU[00] nr_run=0, sort=157, sibling=00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000003, core=00000000,00000000,00000000,00000000,ffffffff,ffffffff,ffffffff,ffffffff
  (XEN) CPU[01] nr_run=0, sort=13750, sibling=00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000003, core=00000000,00000000,00000000,00000000,ffffffff,ffffffff,ffffffff,ffffffff
  (XEN) CPU[02] nr_run=0, sort=188, sibling=00000000,00000000,00000000,00000000,00000000,00000000,00000000,0000000c, core=00000000,00000000,00000000,00000000,ffffffff,ffffffff,ffffffff,ffffffff
  (XEN) CPU[03] nr_run=0, sort=13730, sibling=00000000,00000000,00000000,00000000,00000000,00000000,00000000,0000000c, core=00000000,00000000,00000000,00000000,ffffffff,ffffffff,ffffffff,ffffffff

After:
  (XEN) CPU[00] nr_run=0, sort=1169, sibling={0-1}, core={0-127}
  (XEN) CPU[01] nr_run=0, sort=2488, sibling={0-1}, core={0-127}
  (XEN) CPU[02] nr_run=0, sort=1210, sibling={2-3}, core={0-127}
  (XEN) CPU[03] nr_run=0, sort=2476, sibling={2-3}, core={0-127}

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Juergen Gross <jgross@suse.com>
CC: Dario Faggioli <dfaggioli@suse.com>
CC: George Dunlap <george.dunlap@eu.citrix.com>

4.13 nice-to-have.  Not strictly required, but it is a low risk change which
improves diagnostics.
---
 xen/common/sched_credit.c  | 2 +-
 xen/common/sched_credit2.c | 2 +-
 xen/common/sched_null.c    | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

Comments

Jürgen Groß Nov. 14, 2019, 7:53 a.m. UTC | #1
On 13.11.19 19:36, Andrew Cooper wrote:
> For system with large numbers of CPUs, the 'r' debugkey is unwieldy.  Sibling
> and core masks are a single block of adjacent bits, so are vastly shorter to
> render with %pbl.
> 
> Before:
>    (XEN) CPU[00] nr_run=0, sort=157, sibling=00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000003, core=00000000,00000000,00000000,00000000,ffffffff,ffffffff,ffffffff,ffffffff
>    (XEN) CPU[01] nr_run=0, sort=13750, sibling=00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000003, core=00000000,00000000,00000000,00000000,ffffffff,ffffffff,ffffffff,ffffffff
>    (XEN) CPU[02] nr_run=0, sort=188, sibling=00000000,00000000,00000000,00000000,00000000,00000000,00000000,0000000c, core=00000000,00000000,00000000,00000000,ffffffff,ffffffff,ffffffff,ffffffff
>    (XEN) CPU[03] nr_run=0, sort=13730, sibling=00000000,00000000,00000000,00000000,00000000,00000000,00000000,0000000c, core=00000000,00000000,00000000,00000000,ffffffff,ffffffff,ffffffff,ffffffff
> 
> After:
>    (XEN) CPU[00] nr_run=0, sort=1169, sibling={0-1}, core={0-127}
>    (XEN) CPU[01] nr_run=0, sort=2488, sibling={0-1}, core={0-127}
>    (XEN) CPU[02] nr_run=0, sort=1210, sibling={2-3}, core={0-127}
>    (XEN) CPU[03] nr_run=0, sort=2476, sibling={2-3}, core={0-127}
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Reviewed-by: Juergen Gross <jgross@suse.com>
Release-acked-by: Juergen Gross <jgross@suse.com>


Juergen
George Dunlap Nov. 14, 2019, 3:04 p.m. UTC | #2
On 11/13/19 6:36 PM, Andrew Cooper wrote:
> For system with large numbers of CPUs, the 'r' debugkey is unwieldy.  Sibling
> and core masks are a single block of adjacent bits, so are vastly shorter to
> render with %pbl.
> 
> Before:
>   (XEN) CPU[00] nr_run=0, sort=157, sibling=00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000003, core=00000000,00000000,00000000,00000000,ffffffff,ffffffff,ffffffff,ffffffff
>   (XEN) CPU[01] nr_run=0, sort=13750, sibling=00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000003, core=00000000,00000000,00000000,00000000,ffffffff,ffffffff,ffffffff,ffffffff
>   (XEN) CPU[02] nr_run=0, sort=188, sibling=00000000,00000000,00000000,00000000,00000000,00000000,00000000,0000000c, core=00000000,00000000,00000000,00000000,ffffffff,ffffffff,ffffffff,ffffffff
>   (XEN) CPU[03] nr_run=0, sort=13730, sibling=00000000,00000000,00000000,00000000,00000000,00000000,00000000,0000000c, core=00000000,00000000,00000000,00000000,ffffffff,ffffffff,ffffffff,ffffffff
> 
> After:
>   (XEN) CPU[00] nr_run=0, sort=1169, sibling={0-1}, core={0-127}
>   (XEN) CPU[01] nr_run=0, sort=2488, sibling={0-1}, core={0-127}
>   (XEN) CPU[02] nr_run=0, sort=1210, sibling={2-3}, core={0-127}
>   (XEN) CPU[03] nr_run=0, sort=2476, sibling={2-3}, core={0-127}
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Acked-by: George Dunlap <george.dunlap@citrix.com>

Patch
diff mbox series

diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c
index 645cdc5e9a..aa41a3301b 100644
--- a/xen/common/sched_credit.c
+++ b/xen/common/sched_credit.c
@@ -2065,7 +2065,7 @@  csched_dump_pcpu(const struct scheduler *ops, int cpu)
     spc = CSCHED_PCPU(cpu);
     runq = &spc->runq;
 
-    printk("CPU[%02d] nr_run=%d, sort=%d, sibling=%*pb, core=%*pb\n",
+    printk("CPU[%02d] nr_run=%d, sort=%d, sibling={%*pbl}, core={%*pbl}\n",
            cpu, spc->nr_runnable, spc->runq_sort_last,
            CPUMASK_PR(per_cpu(cpu_sibling_mask, cpu)),
            CPUMASK_PR(per_cpu(cpu_core_mask, cpu)));
diff --git a/xen/common/sched_credit2.c b/xen/common/sched_credit2.c
index af58ee161d..f7c477053c 100644
--- a/xen/common/sched_credit2.c
+++ b/xen/common/sched_credit2.c
@@ -3658,7 +3658,7 @@  dump_pcpu(const struct scheduler *ops, int cpu)
     struct csched2_private *prv = csched2_priv(ops);
     struct csched2_unit *svc;
 
-    printk("CPU[%02d] runq=%d, sibling=%*pb, core=%*pb\n",
+    printk("CPU[%02d] runq=%d, sibling={%*pbl}, core={%*pbl}\n",
            cpu, c2r(cpu),
            CPUMASK_PR(per_cpu(cpu_sibling_mask, cpu)),
            CPUMASK_PR(per_cpu(cpu_core_mask, cpu)));
diff --git a/xen/common/sched_null.c b/xen/common/sched_null.c
index da3fe29f21..3f3418c9b1 100644
--- a/xen/common/sched_null.c
+++ b/xen/common/sched_null.c
@@ -926,7 +926,7 @@  static void null_dump_pcpu(const struct scheduler *ops, int cpu)
 
     lock = pcpu_schedule_lock_irqsave(cpu, &flags);
 
-    printk("CPU[%02d] sibling=%*pb, core=%*pb",
+    printk("CPU[%02d] sibling={%*pbl}, core={%*pbl}",
            cpu, CPUMASK_PR(per_cpu(cpu_sibling_mask, cpu)),
            CPUMASK_PR(per_cpu(cpu_core_mask, cpu)));
     if ( per_cpu(npc, cpu).unit != NULL )