Re: [PATCH 12/17] freezer: clean up freeze_processes() failure path

From: Srivatsa S. Bhat
Date: Thu Nov 03 2011 - 15:09:37 EST


Hi,

On 11/01/2011 12:35 AM, Tejun Heo wrote:
> freeze_processes() failure path is rather messy. Freezing is canceled
> for workqueues and tasks which aren't frozen yet but frozen tasks are
> left alone and should be thawed by the caller and of course some
> callers (xen and kexec) didn't do it.
>
> This patch updates __thaw_task() to handle cancelation correctly and
> makes thaw_processes() call thaw_processes() on failure instead so
^^^^^^^^^^^^^^
You meant freeze_processes() and freeze_kernel_threads() here, right?

> that the system is fully thawed on failure.

I really like this approach of handling freezing failures.

> Unnecessary
> thaw_processes() calls are removed from kernel/power/hibernate.c and
> user.c.
>
Did you miss kernel/power/suspend.c?
Shouldn't we be also doing something like this:

Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@xxxxxxxxxxxxxxxxxx>
---

diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c
index fdd4263..57aaca5 100644
--- a/kernel/power/suspend.c
+++ b/kernel/power/suspend.c
@@ -110,7 +110,6 @@ static int suspend_prepare(void)
} else
return 0;

- suspend_thaw_processes();
usermodehelper_enable();
Finish:
pm_notifier_call_chain(PM_POST_SUSPEND);



---
Regards,
Srivatsa S. Bhat <srivatsa.bhat@xxxxxxxxxxxxxxxxxx>
Linux Technology Center,
IBM India Systems and Technology Lab

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/