More specifically:
1) rename vcpu_destroy 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.
2) rename vcpu_init to vcpu_alloc
As it lives in *_alloc_vdata.
3) add vcpu_insert
matching vcpu_remove, and useful to quickly check
whether the number of insertions and removal matches,
or in general investigare their relationship.
Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Acked-by: George Dunlap <george.dunlap@citrix.com>
svc->pri = is_idle_domain(vc->domain) ?
CSCHED_PRI_IDLE : CSCHED_PRI_TS_UNDER;
SCHED_VCPU_STATS_RESET(svc);
- SCHED_STAT_CRANK(vcpu_init);
+ SCHED_STAT_CRANK(vcpu_alloc);
return svc;
}
if ( !__vcpu_on_runq(svc) && vcpu_runnable(vc) && !vc->is_running )
__runq_insert(vc->processor, svc);
+
+ SCHED_STAT_CRANK(vcpu_insert);
}
static void
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) )
{
svc->weight = 0;
}
- SCHED_STAT_CRANK(vcpu_init);
+ SCHED_STAT_CRANK(vcpu_alloc);
return svc;
}
vcpu_schedule_unlock_irq(lock, vc);
sdom->nr_vcpus++;
+
+ SCHED_STAT_CRANK(vcpu_insert);
}
CSCHED2_VCPU_CHECK(vc);
{
spinlock_t *lock;
- SCHED_STAT_CRANK(vcpu_destroy);
+ SCHED_STAT_CRANK(vcpu_remove);
/* Remove from runqueue */
lock = vcpu_schedule_lock_irq(vc);
if ( !is_idle_vcpu(vc) )
svc->budget = RTDS_DEFAULT_BUDGET;
- SCHED_STAT_CRANK(vcpu_init);
+ SCHED_STAT_CRANK(vcpu_alloc);
return svc;
}
/* add rt_vcpu svc to scheduler-specific vcpu list of the dom */
list_add_tail(&svc->sdom_elem, &svc->sdom->vcpu);
+
+ SCHED_STAT_CRANK(vcpu_insert);
}
/*
struct rt_dom * const sdom = svc->sdom;
spinlock_t *lock;
- SCHED_STAT_CRANK(vcpu_destroy);
+ SCHED_STAT_CRANK(vcpu_remove);
BUG_ON( sdom == NULL );
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_alloc, "sched: vcpu_alloc")
+PERFCOUNTER(vcpu_insert, "sched: vcpu_insert")
+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")