diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2010-04-20 14:32:53 +0100 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2010-04-20 14:32:53 +0100 |
commit | 3cd0ba42d51b8bb2b8e534b52c7d8f10e1676868 (patch) | |
tree | dd57155b28e5986b6e17b3fa0aacfb00d1a614bd /xen/common/tasklet.c | |
parent | 6da2b1ae559126b753c7c653b31bd83b56962bbc (diff) | |
download | xen-3cd0ba42d51b8bb2b8e534b52c7d8f10e1676868.tar.gz xen-3cd0ba42d51b8bb2b8e534b52c7d8f10e1676868.tar.bz2 xen-3cd0ba42d51b8bb2b8e534b52c7d8f10e1676868.zip |
tasklet: Add lock-free exit path from do_tasklet() when no work to do.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Diffstat (limited to 'xen/common/tasklet.c')
-rw-r--r-- | xen/common/tasklet.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/xen/common/tasklet.c b/xen/common/tasklet.c index 05665ebc5d..e2109770ad 100644 --- a/xen/common/tasklet.c +++ b/xen/common/tasklet.c @@ -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; |