WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH 3 of 3] credit2: Trace and debug key tweaks

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH 3 of 3] credit2: Trace and debug key tweaks
From: George Dunlap <george.dunlap@xxxxxxxxxxxxx>
Date: Tue, 26 Oct 2010 11:22:10 +0100
Cc: george.dunlap@xxxxxxxxxxxxx
Delivery-date: Tue, 26 Oct 2010 03:27:10 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <patchbomb.1288088527@gdunlap-desktop>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <patchbomb.1288088527@gdunlap-desktop>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mercurial-patchbomb/1.4.3
* 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@xxxxxxxxxxxxx>

diff -r 9a3d5ed84604 -r e2eed64cf0d5 xen/common/sched_credit2.c
--- a/xen/common/sched_credit2.c        Tue Oct 26 11:06:14 2010 +0100
+++ b/xen/common/sched_credit2.c        Tue Oct 26 11:06:16 2010 +0100
@@ -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 @@
         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 @@
     {
         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 @@
         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 @@
         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 @@
     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 @@
 
     /* 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;

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>