[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen master] sched: make counters for vCPU sleep and wakeup generic
commit 8b0e94da0e23221a6d7ea19bfbd24a407db44de8 Author: Dario Faggioli <dario.faggioli@xxxxxxxxxx> AuthorDate: Tue Mar 17 10:56:48 2015 +0100 Commit: Jan Beulich <jbeulich@xxxxxxxx> CommitDate: Tue Mar 17 10:56:48 2015 +0100 sched: make counters for vCPU sleep and wakeup generic and update them from Credit2 and RTDS. In Credit2, while there, remove some stale comments too. Signed-off-by: Dario Faggioli <dario.faggioli@xxxxxxxxxx> Reviewed-by: Meng Xu <mengxu@xxxxxxxxxxxxx> Acked-by: Jan Beulich <jbeulich@xxxxxxxx> Acked-by: George Dunlap <george.dunlap@xxxxxxxxxxxxx> --- xen/common/sched_credit2.c | 11 ++++++++--- xen/common/sched_rt.c | 12 ++++++++++++ xen/include/xen/perfc_defn.h | 10 +++++----- 3 files changed, 25 insertions(+), 8 deletions(-) diff --git a/xen/common/sched_credit2.c b/xen/common/sched_credit2.c index f0e2c82..7655ad4 100644 --- a/xen/common/sched_credit2.c +++ b/xen/common/sched_credit2.c @@ -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. */ diff --git a/xen/common/sched_rt.c b/xen/common/sched_rt.c index 58dd646..49d1b83 100644 --- a/xen/common/sched_rt.c +++ b/xen/common/sched_rt.c @@ -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 diff --git a/xen/include/xen/perfc_defn.h b/xen/include/xen/perfc_defn.h index 3ac7b45..2dc78fe 100644 --- a/xen/include/xen/perfc_defn.h +++ b/xen/include/xen/perfc_defn.h @@ -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") -- generated by git-patchbot for /home/xen/git/xen.git#master _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |