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] credit2: Fix tasklets

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] credit2: Fix tasklets
From: George Dunlap <george.dunlap@xxxxxxxxxxxxx>
Date: Tue, 11 May 2010 16:07:33 -0500
Cc: george.dunlap@xxxxxxxxxxxxx
Delivery-date: Tue, 11 May 2010 14:08:31 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
diff -r c7e9f1b99b22 -r befe7b31b451 xen/common/sched_credit2.c
--- a/xen/common/sched_credit2.c        Mon May 10 09:27:17 2010 +0100
+++ b/xen/common/sched_credit2.c        Tue May 11 15:55:27 2010 -0500
@@ -920,16 +920,13 @@
     /* Update credits */
     burn_credits(rqd, scurr, now);
 
-    /* Tasklet work (which runs in idle VCPU context) overrides all else. */
-    if ( !tasklet_queue_empty(cpu) )
-    {
-        snext = CSCHED_VCPU(idle_vcpu[cpu]);
-        goto out;
-    }
-
     /*
      * Select next runnable local VCPU (ie top of local runq).
      *
+     * If there's tasklet work to do, we want to chose the idle vcpu
+     * for this processor, and mark the current for delayed runqueue
+     * add.
+     *
      * If the current vcpu is runnable, and has higher credit than
      * the next guy on the queue (or there is noone else), we want to run him 
again.
      *
@@ -940,7 +937,7 @@
      * If the current vcpu is not runnable, we want to chose the idle
      * vcpu for this processor.
      */
-    if ( list_empty(runq) )
+    if ( list_empty(runq) || !tasklet_queue_empty(cpu) )
         snext = CSCHED_VCPU(idle_vcpu[cpu]);
     else
         snext = __runq_elem(runq->next);
@@ -948,9 +945,10 @@
     if ( !is_idle_vcpu(current) && vcpu_runnable(current) )
     {
         /* If the current vcpu is runnable, and has higher credit
-         * than the next on the runqueue, run him again.
+         * 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 ( scurr->credit > snext->credit)
+        if ( tasklet_queue_empty(cpu) && scurr->credit > snext->credit)
             snext = scurr;
         else
             set_bit(__CSFLAG_delayed_runq_add, &scurr->flags);
@@ -997,7 +995,6 @@
         snext->vcpu->processor = cpu; /* Safe because lock for old processor 
is held */
     }
 
- out:
     /*
      * Return task to run next...
      */

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] credit2: Fix tasklets, George Dunlap <=