Cc: Alan Stern <stern@...>, pm list <linux-pm@...>, LKML <linux-kernel@...>, Matthew Garrett <mjg59@...>, Nigel Cunningham <nigel@...>, Oliver Neukum <oliver@...>
Hi,
On Wednesday, 30 May 2007 17:37, Pavel Machek wrote:
We need PM_PRE_FREEZE anyway and it's a different question whether or not
it'll be used for suspend (STR) too.
The timing is not the best one, but so far the freezer is in the suspend code
path and I need to take this into account.
Well, there is a reason for not doing this. Namely, if the memory if freed on
PM_POST_HIBERNATION after the image has been created, we can use it for saving
the image (and speed up the saving).
Besides, if the freezer is dropped from the suspend code, the notifiers will be
useful to it anyway IMO, and PRE_FREEZE won't make sense in that case.
I think the rule should be: If you need to do something _before_ tasks are
frozen, do it in PM_PRE_FREEZE, but if you can do that after the tasks have
been frozen, do it on PM_HIBERNATION_PREPARE (or PM_SUSPEND_PREPARE in the
suspend case).
Greetings,
Rafael
-