Skip to contentSkip to conversation

xen: sched: rename vcpu_destroy perf counter to vcpu_remove

PATCH In review Dario Faggioli 2 participants 3 messages Sep 24, 2015 – Sep 25, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen: sched: rename vcpu_destroy perf counter to vcpu_remove

It seems this have had to be done as part of 7e6b926a ("cpupools: Make interface more consistent"), which renamed the function but not the counter.

In fact, because of cpupools, vcpus are not only removed from a scheduler when they are destroyed, but also when domains move between pools.

Make the related statistics counter reflect that more properly.

---
Cc: George Dunlap <[email protected]>
Cc: Juergen Gross <[email protected]>
Cc: Meng Xu <[email protected]>
Cc: Jan Beulich <[email protected]>

---
 xen/common/sched_credit.c    |    2 +-
 xen/common/sched_credit2.c   |    2 +-
 xen/common/sched_rt.c        |    2 +-
 xen/include/xen/perfc_defn.h |    2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)
xen/common/sched_credit.c +1 -1
index a1945ac..fb05276 100644
@@ -927,7 +927,7 @@ csched_vcpu_remove(const struct scheduler *ops, struct vcpu *vc)
     struct csched_dom * const sdom = svc->sdom;
     unsigned long flags;
 
-    SCHED_STAT_CRANK(vcpu_destroy);
+    SCHED_STAT_CRANK(vcpu_remove);
 
     if ( test_and_clear_bit(CSCHED_FLAG_VCPU_PARKED, &svc->flags) )
     {
xen/common/sched_credit2.c +1 -1
index 75e0321..135cf88 100644
@@ -917,7 +917,7 @@ csched2_vcpu_remove(const struct scheduler *ops, struct vcpu *vc)
     {
         spinlock_t *lock;
 
-        SCHED_STAT_CRANK(vcpu_destroy);
+        SCHED_STAT_CRANK(vcpu_remove);
 
         /* Remove from runqueue */
         lock = vcpu_schedule_lock_irq(vc);
xen/common/sched_rt.c +1 -1
index 4372486..31b0a9e 100644
@@ -648,7 +648,7 @@ rt_vcpu_remove(const struct scheduler *ops, struct vcpu *vc)
     struct rt_dom * const sdom = svc->sdom;
     spinlock_t *lock;
 
-    SCHED_STAT_CRANK(vcpu_destroy);
+    SCHED_STAT_CRANK(vcpu_remove);
 
     BUG_ON( sdom == NULL );
 
xen/include/xen/perfc_defn.h +1 -1
index 526002d..43d1dfd 100644
@@ -20,7 +20,7 @@ PERFCOUNTER(schedule,               "sched: specific scheduler")
 PERFCOUNTER(dom_init,               "sched: dom_init")
 PERFCOUNTER(dom_destroy,            "sched: dom_destroy")
 PERFCOUNTER(vcpu_init,              "sched: vcpu_init")
-PERFCOUNTER(vcpu_destroy,           "sched: vcpu_destroy")
+PERFCOUNTER(vcpu_remove,            "sched: vcpu_remove")
 PERFCOUNTER(vcpu_sleep,             "sched: vcpu_sleep")
 PERFCOUNTER(vcpu_wake_running,      "sched: vcpu_wake_running")
 PERFCOUNTER(vcpu_wake_onrunq,       "sched: vcpu_wake_onrunq")
Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Dario Faggioli

It seems this have had to be done as part of 7e6b926a ("cpupools: Make interface more consistent"), which renamed the function but not the counter.

Quoted 8 lines

In fact, because of cpupools, vcpus are not only removed from a scheduler when they are destroyed, but also when domains move between pools.

Make the related statistics counter reflect that more properly.

I'd change the following as well for the same reason:

vcpu_init -> vcpu_alloc_vdata

Nevertheless:

Quoted 66 lines

---
Cc: George Dunlap <[email protected]>
Cc: Juergen Gross <[email protected]>
Cc: Meng Xu <[email protected]>
Cc: Jan Beulich <[email protected]>

---
  xen/common/sched_credit.c    |    2 +-
  xen/common/sched_credit2.c   |    2 +-
  xen/common/sched_rt.c        |    2 +-
  xen/include/xen/perfc_defn.h |    2 +-
  4 files changed, 4 insertions(+), 4 deletions(-)
xen/common/sched_credit.c +1 -1
index a1945ac..fb05276 100644
@@ -927,7 +927,7 @@ csched_vcpu_remove(const struct scheduler *ops, struct vcpu *vc)
      struct csched_dom * const sdom = svc->sdom;
      unsigned long flags;
 
-    SCHED_STAT_CRANK(vcpu_destroy);
+    SCHED_STAT_CRANK(vcpu_remove);
 
      if ( test_and_clear_bit(CSCHED_FLAG_VCPU_PARKED, &svc->flags) )
      {
xen/common/sched_credit2.c +1 -1
index 75e0321..135cf88 100644
@@ -917,7 +917,7 @@ csched2_vcpu_remove(const struct scheduler *ops, struct vcpu *vc)
      {
          spinlock_t *lock;
 
-        SCHED_STAT_CRANK(vcpu_destroy);
+        SCHED_STAT_CRANK(vcpu_remove);
 
          /* Remove from runqueue */
          lock = vcpu_schedule_lock_irq(vc);
xen/common/sched_rt.c +1 -1
index 4372486..31b0a9e 100644
@@ -648,7 +648,7 @@ rt_vcpu_remove(const struct scheduler *ops, struct vcpu *vc)
      struct rt_dom * const sdom = svc->sdom;
      spinlock_t *lock;
 
-    SCHED_STAT_CRANK(vcpu_destroy);
+    SCHED_STAT_CRANK(vcpu_remove);
 
      BUG_ON( sdom == NULL );
 
xen/include/xen/perfc_defn.h +1 -1
index 526002d..43d1dfd 100644
@@ -20,7 +20,7 @@ PERFCOUNTER(schedule,               "sched: specific scheduler")
  PERFCOUNTER(dom_init,               "sched: dom_init")
  PERFCOUNTER(dom_destroy,            "sched: dom_destroy")
  PERFCOUNTER(vcpu_init,              "sched: vcpu_init")
-PERFCOUNTER(vcpu_destroy,           "sched: vcpu_destroy")
+PERFCOUNTER(vcpu_remove,            "sched: vcpu_remove")
  PERFCOUNTER(vcpu_sleep,             "sched: vcpu_sleep")
  PERFCOUNTER(vcpu_wake_running,      "sched: vcpu_wake_running")
  PERFCOUNTER(vcpu_wake_onrunq,       "sched: vcpu_wake_onrunq")
#2 lore raw
Quoted 9 lines · Juergen Gross
Quoted 8 lines · Dario Faggioli

It seems this have had to be done as part of 7e6b926a ("cpupools: Make interface more consistent"), which renamed the function but not the counter.

In fact, because of cpupools, vcpus are not only removed from a scheduler when they are destroyed, but also when domains move between pools.

Quoted 9 lines
Quoted 4 lines

Make the related statistics counter reflect that more properly.

I'd change the following as well for the same reason:

vcpu_init -> vcpu_alloc_vdata

Good point, I'll do that (although I may go for "vcpu_alloc" as a name) .

Thanks and Regards,
Dario

Signature · 4 lines
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://about.me/dario.faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel