]> git.karo-electronics.de Git - karo-tx-linux.git/commit
xen: only enable interrupts while actually blocking for spinlock
authorJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Wed, 9 Sep 2009 19:33:51 +0000 (12:33 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 5 Oct 2009 16:31:44 +0000 (09:31 -0700)
commit64aa234c396c3f595bc08aed93fd753102a0a0ec
treee88f043466a1b36d2ed90f5a5a875a65f7fa59f3
parentb04a12a2837b961139be63eb4b4f23c38a140e4a
xen: only enable interrupts while actually blocking for spinlock

commit 4d576b57b50a92801e6493e76e5243d6cff193d2 upstream.

Where possible we enable interrupts while waiting for a spinlock to
become free, in order to reduce big latency spikes in interrupt handling.

However, at present if we manage to pick up the spinlock just before
blocking, we'll end up holding the lock with interrupts enabled for a
while.  This will cause a deadlock if we recieve an interrupt in that
window, and the interrupt handler tries to take the lock too.

Solve this by shrinking the interrupt-enabled region to just around the
blocking call.

[ Impact: avoid race/deadlock when using Xen PV spinlocks ]

Reported-by: "Yang, Xiaowei" <xiaowei.yang@intel.com>
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
arch/x86/xen/spinlock.c