]> xenbits.xensource.com Git - xen.git/commitdiff
tasklet: Add lock-free exit path from do_tasklet() when no work to do.
authorKeir Fraser <keir.fraser@citrix.com>
Tue, 20 Apr 2010 13:32:53 +0000 (14:32 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Tue, 20 Apr 2010 13:32:53 +0000 (14:32 +0100)
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
xen/common/tasklet.c

index 05665ebc5ddfa230254a5cc856158dcd85e244d4..e2109770ad480889f5684df25eae7d62c8383441 100644 (file)
@@ -60,9 +60,12 @@ void do_tasklet(void)
     struct list_head *list = &per_cpu(tasklet_list, cpu);
     struct tasklet *t;
 
+    if ( likely(list_empty(list)) )
+        return;
+
     spin_lock_irq(&tasklet_lock);
 
-    if ( list_empty(list) )
+    if ( unlikely(list_empty(list)) )
     {
         spin_unlock_irq(&tasklet_lock);
         return;