xen/manage: Always freeze/thaw processes when suspend/resuming
authorRoss Lagerwall <ross.lagerwall@citrix.com>
Mon, 18 Aug 2014 09:41:36 +0000 (10:41 +0100)
committerBen Hutchings <ben@decadent.org.uk>
Wed, 5 Nov 2014 20:27:40 +0000 (20:27 +0000)
commit11d3b506cc0db26d2f2078bd4df88803cd06c819
tree320dfcc82f00b91e8c1f3703581aa375476b5d67
parentdd27db6dbfd3ccac0806576b572a86f213a59208
xen/manage: Always freeze/thaw processes when suspend/resuming

commit 61a734d305e16944b42730ef582a7171dc733321 upstream.

Always freeze processes when suspending and thaw processes when resuming
to prevent a race noticeable with HVM guests.

This prevents a deadlock where the khubd kthread (which is designed to
be freezable) acquires a usb device lock and then tries to allocate
memory which requires the disk which hasn't been resumed yet.
Meanwhile, the xenwatch thread deadlocks waiting for the usb device
lock.

Freezing processes fixes this because the khubd thread is only thawed
after the xenwatch thread finishes resuming all the devices.

Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/xen/manage.c