diff -r eb4505f8dd97 xen/common/schedule.c --- a/xen/common/schedule.c Wed Apr 20 12:02:51 2011 +0100 +++ b/xen/common/schedule.c Fri Apr 22 03:46:00 2011 -0500 @@ -455,9 +455,20 @@ pick_called = 0; } - if ( old_lock != new_lock ) + if ( old_lock == new_lock ) + { + spin_unlock_irqrestore(old_lock, flags); + } + else if ( old_lock < new_lock ) + { spin_unlock(new_lock); - spin_unlock_irqrestore(old_lock, flags); + spin_unlock_irqrestore(old_lock, flags); + } + else + { + spin_unlock(old_lock); + spin_unlock_irqrestore(new_lock, flags); + } } /* @@ -468,9 +479,20 @@ if ( v->is_running || !test_and_clear_bit(_VPF_migrating, &v->pause_flags) ) { - if ( old_lock != new_lock ) + if ( old_lock == new_lock ) + { + spin_unlock_irqrestore(old_lock, flags); + } + else if ( old_lock < new_lock ) + { spin_unlock(new_lock); - spin_unlock_irqrestore(old_lock, flags); + spin_unlock_irqrestore(old_lock, flags); + } + else + { + spin_unlock(old_lock); + spin_unlock_irqrestore(new_lock, flags); + } return; } @@ -491,9 +513,20 @@ */ v->processor = new_cpu; - if ( old_lock != new_lock ) + if ( old_lock == new_lock ) + { + spin_unlock_irqrestore(old_lock, flags); + } + else if ( old_lock < new_lock ) + { spin_unlock(new_lock); - spin_unlock_irqrestore(old_lock, flags); + spin_unlock_irqrestore(old_lock, flags); + } + else + { + spin_unlock_irqrestore(old_lock, flags); + spin_unlock(new_lock); + } if ( old_cpu != new_cpu ) evtchn_move_pirqs(v);