]> xenbits.xensource.com Git - people/gdunlap/xen.git/commitdiff
sched: make counters for vCPU sleep and wakeup generic
authorDario Faggioli <dario.faggioli@citrix.com>
Tue, 17 Mar 2015 09:56:48 +0000 (10:56 +0100)
committerJan Beulich <jbeulich@suse.com>
Tue, 17 Mar 2015 09:56:48 +0000 (10:56 +0100)
and update them from Credit2 and RTDS. In Credit2, while there,
remove some stale comments too.

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Reviewed-by: Meng Xu <mengxu@cis.upenn.edu>
Acked-by: Jan Beulich <jbeulich@suse.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
xen/common/sched_credit2.c
xen/common/sched_rt.c
xen/include/xen/perfc_defn.h

index f0e2c82e71dbbfd27962eec663a4a2a85ca55e6f..7655ad4c4c1d4dfd338cadce599665a7b18f8dd6 100644 (file)
@@ -931,6 +931,7 @@ csched2_vcpu_sleep(const struct scheduler *ops, struct vcpu *vc)
     struct csched2_vcpu * const svc = CSCHED2_VCPU(vc);
 
     BUG_ON( is_idle_vcpu(vc) );
+    SCHED_STAT_CRANK(vcpu_sleep);
 
     if ( curr_on_cpu(vc->processor) == vc )
         cpu_raise_softirq(vc->processor, SCHEDULE_SOFTIRQ);
@@ -956,19 +957,23 @@ csched2_vcpu_wake(const struct scheduler *ops, struct vcpu *vc)
 
     BUG_ON( is_idle_vcpu(vc) );
 
-    /* Make sure svc priority mod happens before runq check */
     if ( unlikely(curr_on_cpu(vc->processor) == vc) )
     {
+        SCHED_STAT_CRANK(vcpu_wake_running);
         goto out;
     }
 
     if ( unlikely(__vcpu_on_runq(svc)) )
     {
-        /* If we've boosted someone that's already on a runqueue, prioritize
-         * it and inform the cpu in question. */
+        SCHED_STAT_CRANK(vcpu_wake_onrunq);
         goto out;
     }
 
+    if ( likely(vcpu_runnable(vc)) )
+        SCHED_STAT_CRANK(vcpu_wake_runnable);
+    else
+        SCHED_STAT_CRANK(vcpu_wake_not_runnable);
+
     /* If the context hasn't been saved for this vcpu yet, we can't put it on
      * another runqueue.  Instead, we set a flag so that it will be put on the runqueue
      * after the context has been saved. */
index 58dd64690866500b0dcc30c386221d10be880af7..49d1b830c631431f4dc9cf78cc8be7e21514ed4f 100644 (file)
@@ -851,6 +851,7 @@ rt_vcpu_sleep(const struct scheduler *ops, struct vcpu *vc)
     struct rt_vcpu * const svc = rt_vcpu(vc);
 
     BUG_ON( is_idle_vcpu(vc) );
+    SCHED_STAT_CRANK(vcpu_sleep);
 
     if ( curr_on_cpu(vc->processor) == vc )
         cpu_raise_softirq(vc->processor, SCHEDULE_SOFTIRQ);
@@ -966,11 +967,22 @@ rt_vcpu_wake(const struct scheduler *ops, struct vcpu *vc)
     BUG_ON( is_idle_vcpu(vc) );
 
     if ( unlikely(curr_on_cpu(vc->processor) == vc) )
+    {
+        SCHED_STAT_CRANK(vcpu_wake_running);
         return;
+    }
 
     /* on RunQ/DepletedQ, just update info is ok */
     if ( unlikely(__vcpu_on_q(svc)) )
+    {
+        SCHED_STAT_CRANK(vcpu_wake_onrunq);
         return;
+    }
+
+    if ( likely(vcpu_runnable(vc)) )
+        SCHED_STAT_CRANK(vcpu_wake_runnable);
+    else
+        SCHED_STAT_CRANK(vcpu_wake_not_runnable);
 
     /* If context hasn't been saved for this vcpu yet, we can't put it on
      * the Runqueue/DepletedQ. Instead, we set a flag so that it will be
index 3ac7b45ac313ddda3d52fd4a6050d8e0d54a1344..2dc78fe848fbfa655df4cae04e6fa4b939f63e13 100644 (file)
@@ -21,6 +21,11 @@ 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_sleep,             "sched: vcpu_sleep")
+PERFCOUNTER(vcpu_wake_running,      "sched: vcpu_wake_running")
+PERFCOUNTER(vcpu_wake_onrunq,       "sched: vcpu_wake_onrunq")
+PERFCOUNTER(vcpu_wake_runnable,     "sched: vcpu_wake_runnable")
+PERFCOUNTER(vcpu_wake_not_runnable, "sched: vcpu_wake_not_runnable")
 
 /* credit specific counters */
 PERFCOUNTER(delay_ms,               "csched: delay")
@@ -32,11 +37,6 @@ PERFCOUNTER(acct_reorder,           "csched: acct_reorder")
 PERFCOUNTER(acct_min_credit,        "csched: acct_min_credit")
 PERFCOUNTER(acct_vcpu_active,       "csched: acct_vcpu_active")
 PERFCOUNTER(acct_vcpu_idle,         "csched: acct_vcpu_idle")
-PERFCOUNTER(vcpu_sleep,             "csched: vcpu_sleep")
-PERFCOUNTER(vcpu_wake_running,      "csched: vcpu_wake_running")
-PERFCOUNTER(vcpu_wake_onrunq,       "csched: vcpu_wake_onrunq")
-PERFCOUNTER(vcpu_wake_runnable,     "csched: vcpu_wake_runnable")
-PERFCOUNTER(vcpu_wake_not_runnable, "csched: vcpu_wake_not_runnable")
 PERFCOUNTER(vcpu_park,              "csched: vcpu_park")
 PERFCOUNTER(vcpu_unpark,            "csched: vcpu_unpark")
 PERFCOUNTER(tickle_idlers_none,     "csched: tickle_idlers_none")