[Suspend-devel] [RFC][PATCH -mm 1/5] PM: Make freeze_processes SMP-safe

2006-11-25 Thread Rafael J. Wysocki
Currently, the PF_FREEZE process flag is used to indicate that the process should enter the refrigerator as soon as possible. Unfortunately it is set by the freezer while the process may be changing its flags for another reason and this may lead to a race between the freezer and the process itself

[Suspend-devel] [RFC][PATCH -mm 3/5] swsusp: Change code ordering in user.c

2006-11-25 Thread Rafael J. Wysocki
Change the ordering of code in kernel/power/user.c so that device_suspend() is called before disable_nonboot_cpus() and device_resume() is called after enable_nonboot_cpus(). The changes here only affect the userland interface of swsusp. Signed-off-by: Rafael J. Wysocki <[EMAIL PROTECTED]> --- k

[Suspend-devel] [RFC][PATCH -mm 2/5] swsusp: Change code ordering in disk.c

2006-11-25 Thread Rafael J. Wysocki
Change the ordering of code in kernel/power/disk.c so that device_suspend() is called before disable_nonboot_cpus() and platform_finish() is called after enable_nonboot_cpus() and before device_resume(). The changes here only affect the built-in swsusp. Signed-off-by: Rafael J. Wysocki <[EMAIL PR

[Suspend-devel] [RFC][PATCH -mm] PM: Change ordering of suspend and resume code

2006-11-25 Thread Rafael J. Wysocki
Hi, The discussion in a recent thread on Linux-PM has indicated that it's necessary to call pm_ops->finish() before devce_resume(), but enable_nonboot_cpus() has to be called before pm_ops->finish() (cf. http://lists.osdl.org/pipermail/linux-pm/2006-November/004164.html). For consistency, it seems

[Suspend-devel] [RFC][PATCH -mm 5/5] PM: Change code ordering in main.c

2006-11-25 Thread Rafael J. Wysocki
Change the ordering of code in kernel/power/main.c so that device_suspend() is called before disable_nonboot_cpus() and pm_ops->finish() is called after enable_nonboot_cpus() and before device_resume(). Signed-off-by: Rafael J. Wysocki <[EMAIL PROTECTED]> --- kernel/power/main.c | 34 ++

[Suspend-devel] [RFC][PATCH -mm 4/5] swsusp: Add PLATFORM_SNAPSHOT and PLATFORM_RESTORE ioctls

2006-11-25 Thread Rafael J. Wysocki
Since pm_ops->finish() has to be called after enable_nonboot_cpus() and before device_resume(), from the userland interface perspective it should be treated as a part of the atomic suspend and resume operations. For this reason we need two additional ioctls to be called instead of ATOMIC_SNAPSHOT

Re: [Suspend-devel] [RFC][PATCH -mm] PM: Change ordering of suspend and resume code

2006-11-25 Thread Pavel Machek
Hi! > The discussion in a recent thread on Linux-PM has indicated that it's > necessary to call pm_ops->finish() before devce_resume(), > but enable_nonboot_cpus() has to be called before pm_ops->finish() > (cf. http://lists.osdl.org/pipermail/linux-pm/2006-November/004164.html). > For consistency

Re: [Suspend-devel] [RFC][PATCH -mm 1/5] PM: Make freeze_processes SMP-safe

2006-11-25 Thread Pavel Machek
Hi! > Currently, the PF_FREEZE process flag is used to indicate that the process > should enter the refrigerator as soon as possible. Unfortunately it is set by > the freezer while the process may be changing its flags for another reason > and this may lead to a race between the freezer and the p