aboutsummaryrefslogtreecommitdiffstats
path: root/xen/common/sched_credit2.c
diff options
context:
space:
mode:
authorKeir Fraser <keir@xen.org>2010-10-29 10:20:33 +0100
committerKeir Fraser <keir@xen.org>2010-10-29 10:20:33 +0100
commitbb6a9806b876ee686f04e11bcb416b71aa3f71a7 (patch)
treec3cbe3f4888269c8256b1780d29af7a33f07bc4c /xen/common/sched_credit2.c
parent1b561702db4910590f1a5607209e645490fde5bb (diff)
downloadxen-bb6a9806b876ee686f04e11bcb416b71aa3f71a7.tar.gz
xen-bb6a9806b876ee686f04e11bcb416b71aa3f71a7.tar.bz2
xen-bb6a9806b876ee686f04e11bcb416b71aa3f71a7.zip
credit2: Trace and debug key tweaks
* Add traces for credit reset and scheduling a tasklet * Remove tsc for traces which probably don't need them * Print domain info in the debug dump Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Diffstat (limited to 'xen/common/sched_credit2.c')
-rw-r--r--xen/common/sched_credit2.c36
1 files changed, 32 insertions, 4 deletions
diff --git a/xen/common/sched_credit2.c b/xen/common/sched_credit2.c
index ce6840c08a..d5196beb54 100644
--- a/xen/common/sched_credit2.c
+++ b/xen/common/sched_credit2.c
@@ -40,6 +40,8 @@
#define TRC_CSCHED2_CREDIT_ADD TRC_SCHED_CLASS + 4
#define TRC_CSCHED2_TICKLE_CHECK TRC_SCHED_CLASS + 5
#define TRC_CSCHED2_TICKLE TRC_SCHED_CLASS + 6
+#define TRC_CSCHED2_CREDIT_RESET TRC_SCHED_CLASS + 7
+#define TRC_CSCHED2_SCHED_TASKLET TRC_SCHED_CLASS + 8
/*
* WARNING: This is still in an experimental phase. Status and work can be found at the
@@ -306,7 +308,7 @@ runq_insert(const struct scheduler *ops, unsigned int cpu, struct csched_vcpu *s
d.dom = svc->vcpu->domain->domain_id;
d.vcpu = svc->vcpu->vcpu_id;
d.pos = pos;
- trace_var(TRC_CSCHED2_RUNQ_POS, 1,
+ trace_var(TRC_CSCHED2_RUNQ_POS, 0,
sizeof(d),
(unsigned char *)&d);
}
@@ -421,8 +423,12 @@ static void reset_credit(const struct scheduler *ops, int cpu, s_time_t now)
{
struct csched_vcpu * svc = list_entry(iter, struct csched_vcpu, rqd_elem);
+ int start_credit;
+
BUG_ON( is_idle_vcpu(svc->vcpu) );
+ start_credit = svc->credit;
+
/* "Clip" credits to max carryover */
if ( svc->credit > CSCHED_CARRYOVER_MAX )
svc->credit = CSCHED_CARRYOVER_MAX;
@@ -430,7 +436,19 @@ static void reset_credit(const struct scheduler *ops, int cpu, s_time_t now)
svc->credit += CSCHED_CREDIT_INIT;
svc->start_time = now;
- /* FIXME: Trace credit */
+ /* TRACE */ {
+ struct {
+ unsigned dom:16,vcpu:16;
+ unsigned credit_start, credit_end;
+ } d;
+ d.dom = svc->vcpu->domain->domain_id;
+ d.vcpu = svc->vcpu->vcpu_id;
+ d.credit_start = start_credit;
+ d.credit_end = svc->credit;
+ trace_var(TRC_CSCHED2_CREDIT_RESET, 0,
+ sizeof(d),
+ (unsigned char *)&d);
+ }
}
/* No need to resort runqueue, as everyone's order should be the same. */
@@ -476,7 +494,7 @@ void burn_credits(struct csched_runqueue_data *rqd, struct csched_vcpu *svc, s_t
d.vcpu = svc->vcpu->vcpu_id;
d.credit = svc->credit;
d.delta = delta;
- trace_var(TRC_CSCHED2_CREDIT_BURN, 1,
+ trace_var(TRC_CSCHED2_CREDIT_BURN, 0,
sizeof(d),
(unsigned char *)&d);
}
@@ -961,16 +979,21 @@ csched_schedule(
else
snext = __runq_elem(runq->next);
+ if ( tasklet_work_scheduled )
+ trace_var(TRC_CSCHED2_SCHED_TASKLET, 0, 0, NULL);
+
if ( !is_idle_vcpu(current) && vcpu_runnable(current) )
{
/* If the current vcpu is runnable, and has higher credit
* than the next on the runqueue, and isn't being preempted
* by a tasklet, run him again.
* Otherwise, set him for delayed runq add. */
+
if ( !tasklet_work_scheduled && scurr->credit > snext->credit)
snext = scurr;
else
set_bit(__CSFLAG_delayed_runq_add, &scurr->flags);
+
}
if ( snext != scurr && !is_idle_vcpu(snext->vcpu) )
@@ -1095,13 +1118,18 @@ csched_dump(const struct scheduler *ops)
/* FIXME: Locking! */
- printk("active vcpus:\n");
+ printk("Domain info:\n");
loop = 0;
list_for_each( iter_sdom, &prv->sdom )
{
struct csched_dom *sdom;
sdom = list_entry(iter_sdom, struct csched_dom, sdom_elem);
+ printk("\tDomain: %d w %d v %d\n\t",
+ sdom->dom->domain_id,
+ sdom->weight,
+ sdom->nr_vcpus);
+
list_for_each( iter_svc, &sdom->vcpu )
{
struct csched_vcpu *svc;