aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/xen
diff options
context:
space:
mode:
authorRoss Lagerwall <ross.lagerwall@citrix.com>2014-08-18 05:41:36 -0400
committerDavid Vrabel <david.vrabel@citrix.com>2014-09-02 10:36:59 -0400
commit61a734d305e16944b42730ef582a7171dc733321 (patch)
tree9b2881c503893fadb5b219a2b88f72461d2ccd7e /drivers/xen
parent7d951f3ccb0308c95bf76d5eef9886dea35a7013 (diff)
xen/manage: Always freeze/thaw processes when suspend/resuming
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> Cc: stable@vger.kernel.org
Diffstat (limited to 'drivers/xen')
-rw-r--r--drivers/xen/manage.c7
1 files changed, 0 insertions, 7 deletions
diff --git a/drivers/xen/manage.c b/drivers/xen/manage.c
index 5f1e1f3cd186..f8bb36f9d9ce 100644
--- a/drivers/xen/manage.c
+++ b/drivers/xen/manage.c
@@ -103,16 +103,11 @@ static void do_suspend(void)
103 103
104 shutting_down = SHUTDOWN_SUSPEND; 104 shutting_down = SHUTDOWN_SUSPEND;
105 105
106#ifdef CONFIG_PREEMPT
107 /* If the kernel is preemptible, we need to freeze all the processes
108 to prevent them from being in the middle of a pagetable update
109 during suspend. */
110 err = freeze_processes(); 106 err = freeze_processes();
111 if (err) { 107 if (err) {
112 pr_err("%s: freeze failed %d\n", __func__, err); 108 pr_err("%s: freeze failed %d\n", __func__, err);
113 goto out; 109 goto out;
114 } 110 }
115#endif
116 111
117 err = dpm_suspend_start(PMSG_FREEZE); 112 err = dpm_suspend_start(PMSG_FREEZE);
118 if (err) { 113 if (err) {
@@ -157,10 +152,8 @@ out_resume:
157 dpm_resume_end(si.cancelled ? PMSG_THAW : PMSG_RESTORE); 152 dpm_resume_end(si.cancelled ? PMSG_THAW : PMSG_RESTORE);
158 153
159out_thaw: 154out_thaw:
160#ifdef CONFIG_PREEMPT
161 thaw_processes(); 155 thaw_processes();
162out: 156out:
163#endif
164 shutting_down = SHUTDOWN_INVALID; 157 shutting_down = SHUTDOWN_INVALID;
165} 158}
166#endif /* CONFIG_HIBERNATE_CALLBACKS */ 159#endif /* CONFIG_HIBERNATE_CALLBACKS */