[3.13.y.z extended stable] Patch "xen/manage: Always freeze/thaw processes when suspend/resuming" has been added to staging queue

Kamal Mostafa kamal at canonical.com
Wed Oct 8 22:14:02 UTC 2014

This is a note to let you know that I have just added a patch titled

    xen/manage: Always freeze/thaw processes when suspend/resuming

to the linux-3.13.y-queue branch of the 3.13.y.z extended stable tree 
which can be found at:


This patch is scheduled to be released in version

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.13.y.z tree, see



>From e33fc19d076a12a02e14618e7383404c6beb6fff Mon Sep 17 00:00:00 2001
From: Ross Lagerwall <ross.lagerwall at citrix.com>
Date: Mon, 18 Aug 2014 10:41:36 +0100
Subject: 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

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 at citrix.com>
Signed-off-by: David Vrabel <david.vrabel at citrix.com>
Signed-off-by: Kamal Mostafa <kamal at canonical.com>
 drivers/xen/manage.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/drivers/xen/manage.c b/drivers/xen/manage.c
index 0bc8086..a344372 100644
--- a/drivers/xen/manage.c
+++ b/drivers/xen/manage.c
@@ -110,16 +110,11 @@ static void do_suspend(void)

 	shutting_down = SHUTDOWN_SUSPEND;

-	/* If the kernel is preemptible, we need to freeze all the processes
-	   to prevent them from being in the middle of a pagetable update
-	   during suspend. */
 	err = freeze_processes();
 	if (err) {
 		pr_err("%s: freeze failed %d\n", __func__, err);
 		goto out;

 	err = dpm_suspend_start(PMSG_FREEZE);
 	if (err) {
@@ -172,10 +167,8 @@ out_resume:
 	dpm_resume_end(si.cancelled ? PMSG_THAW : PMSG_RESTORE);

 	shutting_down = SHUTDOWN_INVALID;

More information about the kernel-team mailing list