[PATCH] xen: make some per-scheduler performance counters sched global ones

Juergen Gross posted 1 patch 2 years, 4 months ago
Test gitlab-ci passed
Patches applied successfully (tree, apply log)
git fetch https://gitlab.com/xen-project/patchew/xen tags/patchew/20211216054502.14085-1-jgross@suse.com
xen/include/xen/perfc_defn.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
[PATCH] xen: make some per-scheduler performance counters sched global ones
Posted by Juergen Gross 2 years, 4 months ago
Some performance counters listed to be credit or credit2 specific are
being used by the null scheduler, too.

Make those sched global ones.

Fixes: ab6ba8c6753fa76 ("perfc: conditionalize credit/credit2 counters")
Signed-off-by: Juergen Gross <jgross@suse.com>
---
 xen/include/xen/perfc_defn.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/include/xen/perfc_defn.h b/xen/include/xen/perfc_defn.h
index 672b51c456..0027d95a60 100644
--- a/xen/include/xen/perfc_defn.h
+++ b/xen/include/xen/perfc_defn.h
@@ -34,6 +34,9 @@ PERFCOUNTER(tickled_idle_cpu,       "sched: tickled_idle_cpu")
 PERFCOUNTER(tickled_idle_cpu_excl,  "sched: tickled_idle_cpu_exclusive")
 PERFCOUNTER(tickled_busy_cpu,       "sched: tickled_busy_cpu")
 PERFCOUNTER(unit_check,             "sched: unit_check")
+PERFCOUNTER(migrate_running,        "sched: migrate_running")
+PERFCOUNTER(migrate_on_runq,        "sched: migrate_on_runq")
+PERFCOUNTER(migrated,               "sched: migrated")
 
 /* credit specific counters */
 #ifdef CONFIG_SCHED_CREDIT
@@ -55,7 +58,6 @@ PERFCOUNTER(steal_trylock,          "csched: steal_trylock")
 PERFCOUNTER(steal_trylock_failed,   "csched: steal_trylock_failed")
 PERFCOUNTER(steal_peer_idle,        "csched: steal_peer_idle")
 PERFCOUNTER(migrate_queued,         "csched: migrate_queued")
-PERFCOUNTER(migrate_running,        "csched: migrate_running")
 PERFCOUNTER(migrate_kicked_away,    "csched: migrate_kicked_away")
 PERFCOUNTER(unit_hot,               "csched: unit_hot")
 #endif
@@ -67,13 +69,11 @@ PERFCOUNTER(acct_load_balance,      "csched2: acct_load_balance")
 PERFCOUNTER(upd_max_weight_quick,   "csched2: update_max_weight_quick")
 PERFCOUNTER(upd_max_weight_full,    "csched2: update_max_weight_full")
 PERFCOUNTER(migrate_requested,      "csched2: migrate_requested")
-PERFCOUNTER(migrate_on_runq,        "csched2: migrate_on_runq")
 PERFCOUNTER(migrate_no_runq,        "csched2: migrate_no_runq")
 PERFCOUNTER(runtime_min_timer,      "csched2: runtime_min_timer")
 PERFCOUNTER(runtime_max_timer,      "csched2: runtime_max_timer")
 PERFCOUNTER(pick_resource,          "csched2: pick_resource")
 PERFCOUNTER(need_fallback_cpu,      "csched2: need_fallback_cpu")
-PERFCOUNTER(migrated,               "csched2: migrated")
 PERFCOUNTER(migrate_resisted,       "csched2: migrate_resisted")
 PERFCOUNTER(credit_reset,           "csched2: credit_reset")
 PERFCOUNTER(deferred_to_tickled_cpu,"csched2: deferred_to_tickled_cpu")
-- 
2.26.2


Re: [PATCH] xen: make some per-scheduler performance counters sched global ones
Posted by Jan Beulich 2 years, 4 months ago
On 16.12.2021 06:45, Juergen Gross wrote:
> Some performance counters listed to be credit or credit2 specific are
> being used by the null scheduler, too.
> 
> Make those sched global ones.
> 
> Fixes: ab6ba8c6753fa76 ("perfc: conditionalize credit/credit2 counters")
> Signed-off-by: Juergen Gross <jgross@suse.com>

As an immediate fix
Reviewed-by: Jan Beulich <jbeulich@suse.com>

Thanks for doing this so quickly.

However, ...

> @@ -55,7 +58,6 @@ PERFCOUNTER(steal_trylock,          "csched: steal_trylock")
>  PERFCOUNTER(steal_trylock_failed,   "csched: steal_trylock_failed")
>  PERFCOUNTER(steal_peer_idle,        "csched: steal_peer_idle")
>  PERFCOUNTER(migrate_queued,         "csched: migrate_queued")
> -PERFCOUNTER(migrate_running,        "csched: migrate_running")
>  PERFCOUNTER(migrate_kicked_away,    "csched: migrate_kicked_away")
>  PERFCOUNTER(unit_hot,               "csched: unit_hot")
>  #endif
> @@ -67,13 +69,11 @@ PERFCOUNTER(acct_load_balance,      "csched2: acct_load_balance")
>  PERFCOUNTER(upd_max_weight_quick,   "csched2: update_max_weight_quick")
>  PERFCOUNTER(upd_max_weight_full,    "csched2: update_max_weight_full")
>  PERFCOUNTER(migrate_requested,      "csched2: migrate_requested")
> -PERFCOUNTER(migrate_on_runq,        "csched2: migrate_on_runq")
>  PERFCOUNTER(migrate_no_runq,        "csched2: migrate_no_runq")
>  PERFCOUNTER(runtime_min_timer,      "csched2: runtime_min_timer")
>  PERFCOUNTER(runtime_max_timer,      "csched2: runtime_max_timer")
>  PERFCOUNTER(pick_resource,          "csched2: pick_resource")
>  PERFCOUNTER(need_fallback_cpu,      "csched2: need_fallback_cpu")
> -PERFCOUNTER(migrated,               "csched2: migrated")

... at least for this one I question the use in the null scheduler:
At the very least I'd expect it shouldn't count what's being counted
by the other two already (i.e. there would be an "else" missing).
But then I'm confused by the the use of these three anyway: Why do
things migrate under null in the first place? This looks to be
contrary to the comment at the top of the file:

 * The 'null' scheduler always choose to run, on each pCPU, either nothing
 * (i.e., the pCPU stays idle) or always the same unit.

Jan


Re: [PATCH] xen: make some per-scheduler performance counters sched global ones
Posted by Stefano Stabellini 2 years, 4 months ago
On Thu, 16 Dec 2021, Jan Beulich wrote:
> On 16.12.2021 06:45, Juergen Gross wrote:
> > Some performance counters listed to be credit or credit2 specific are
> > being used by the null scheduler, too.
> > 
> > Make those sched global ones.
> > 
> > Fixes: ab6ba8c6753fa76 ("perfc: conditionalize credit/credit2 counters")
> > Signed-off-by: Juergen Gross <jgross@suse.com>
> 
> As an immediate fix
> Reviewed-by: Jan Beulich <jbeulich@suse.com>

I tested the patch and it fixes the issue

Tested-by: Stefano Stabellini <sstabellini@kernel.org>