Skip to content
This repository was archived by the owner on Dec 20, 2023. It is now read-only.

Commit 61a734d

Browse files
rosslagerwallDavid Vrabel
authored and
David Vrabel
committed
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 <[email protected]> Signed-off-by: David Vrabel <[email protected]> Cc: [email protected]
1 parent 7d951f3 commit 61a734d

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

Diff for: drivers/xen/manage.c

-7
Original file line numberDiff line numberDiff line change
@@ -103,16 +103,11 @@ static void do_suspend(void)
103103

104104
shutting_down = SHUTDOWN_SUSPEND;
105105

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. */
110106
err = freeze_processes();
111107
if (err) {
112108
pr_err("%s: freeze failed %d\n", __func__, err);
113109
goto out;
114110
}
115-
#endif
116111

117112
err = dpm_suspend_start(PMSG_FREEZE);
118113
if (err) {
@@ -157,10 +152,8 @@ static void do_suspend(void)
157152
dpm_resume_end(si.cancelled ? PMSG_THAW : PMSG_RESTORE);
158153

159154
out_thaw:
160-
#ifdef CONFIG_PREEMPT
161155
thaw_processes();
162156
out:
163-
#endif
164157
shutting_down = SHUTDOWN_INVALID;
165158
}
166159
#endif /* CONFIG_HIBERNATE_CALLBACKS */

0 commit comments

Comments
 (0)