Re: [linux-pm] Re: [PATCH 2/2] Introduce CONFIG_SUSPEND (updated)
On Tuesday, 31 July 2007 11:16, Oliver Neukum wrote: > Am Dienstag 31 Juli 2007 schrieb Rafael J. Wysocki: > > > Well, the people on linux-pm seem to agree that the .suspend() and .resume() > > callbacks are not suitable for runtime power management, so having them > > built without SUSPEND or HIBERNATION wouldn't be very useful. ;-) > > These are what USB runtime power management uses. To be precise, I think the rule should be that if some code is needed for anything else than suspend/hibernation, it should be under plain CONFIG_PM. Still, if something is only needed for suspend/hibernation, it should go under CONFIG_PM_SLEEP or CONFIG_SUSPEND/HIBERNATION, depending on what it's needed for. Now, AFAICS, for the majority of drivers .suspend() and .resume() are only needed for suspend/hibernation and really should be used for suspending only (some other callbacks are needed for hibernation). > How many code paths for power management do you want to introduce? At least one more, for hibernation. That also depends on what approach to the runtime power management is widely accepted. For now, USB is in the vanguard. :-) Greetings, Rafael -- "Premature optimization is the root of all evil." - Donald Knuth - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [linux-pm] Re: [PATCH 2/2] Introduce CONFIG_SUSPEND (updated)
Am Dienstag 31 Juli 2007 schrieb Rafael J. Wysocki: > Well, the people on linux-pm seem to agree that the .suspend() and .resume() > callbacks are not suitable for runtime power management, so having them > built without SUSPEND or HIBERNATION wouldn't be very useful. ;-) These are what USB runtime power management uses. How many code paths for power management do you want to introduce? Regards Oliver - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 2/2] Introduce CONFIG_SUSPEND (updated)
On Tuesday, 31 July 2007 06:59, Len Brown wrote: > On Sunday 29 July 2007 17:27, Rafael J. Wysocki wrote: > > Still, there are many other files in which CONFIG_PM can be replaced > > with CONFIG_PM_SLEEP or even with CONFIG_SUSPEND, but they can be updated in > > the future. > > There is #ifdef CONFIG_PM > around all the .suspend and .resume methods. > > Technically they are PM_DEVICE_STATES or something, > that could really be under PM, and both SUSPEND and HIBERNATE > would depend on PM_DEVICE_STATES, but it is also possible to have > PM_DEVICE_STATES without SUSPEND and HIBERNATE. Well, the people on linux-pm seem to agree that the .suspend() and .resume() callbacks are not suitable for runtime power management, so having them built without SUSPEND or HIBERNATION wouldn't be very useful. ;-) Greetings, Rafael -- "Premature optimization is the root of all evil." - Donald Knuth - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 2/2] Introduce CONFIG_SUSPEND (updated)
On Tuesday, 31 July 2007 06:59, Len Brown wrote: On Sunday 29 July 2007 17:27, Rafael J. Wysocki wrote: Still, there are many other files in which CONFIG_PM can be replaced with CONFIG_PM_SLEEP or even with CONFIG_SUSPEND, but they can be updated in the future. There is #ifdef CONFIG_PM around all the .suspend and .resume methods. Technically they are PM_DEVICE_STATES or something, that could really be under PM, and both SUSPEND and HIBERNATE would depend on PM_DEVICE_STATES, but it is also possible to have PM_DEVICE_STATES without SUSPEND and HIBERNATE. Well, the people on linux-pm seem to agree that the .suspend() and .resume() callbacks are not suitable for runtime power management, so having them built without SUSPEND or HIBERNATION wouldn't be very useful. ;-) Greetings, Rafael -- Premature optimization is the root of all evil. - Donald Knuth - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [linux-pm] Re: [PATCH 2/2] Introduce CONFIG_SUSPEND (updated)
Am Dienstag 31 Juli 2007 schrieb Rafael J. Wysocki: Well, the people on linux-pm seem to agree that the .suspend() and .resume() callbacks are not suitable for runtime power management, so having them built without SUSPEND or HIBERNATION wouldn't be very useful. ;-) These are what USB runtime power management uses. How many code paths for power management do you want to introduce? Regards Oliver - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [linux-pm] Re: [PATCH 2/2] Introduce CONFIG_SUSPEND (updated)
On Tuesday, 31 July 2007 11:16, Oliver Neukum wrote: Am Dienstag 31 Juli 2007 schrieb Rafael J. Wysocki: Well, the people on linux-pm seem to agree that the .suspend() and .resume() callbacks are not suitable for runtime power management, so having them built without SUSPEND or HIBERNATION wouldn't be very useful. ;-) These are what USB runtime power management uses. To be precise, I think the rule should be that if some code is needed for anything else than suspend/hibernation, it should be under plain CONFIG_PM. Still, if something is only needed for suspend/hibernation, it should go under CONFIG_PM_SLEEP or CONFIG_SUSPEND/HIBERNATION, depending on what it's needed for. Now, AFAICS, for the majority of drivers .suspend() and .resume() are only needed for suspend/hibernation and really should be used for suspending only (some other callbacks are needed for hibernation). How many code paths for power management do you want to introduce? At least one more, for hibernation. That also depends on what approach to the runtime power management is widely accepted. For now, USB is in the vanguard. :-) Greetings, Rafael -- Premature optimization is the root of all evil. - Donald Knuth - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 2/2] Introduce CONFIG_SUSPEND (updated)
On Sunday 29 July 2007 17:27, Rafael J. Wysocki wrote: > Still, there are many other files in which CONFIG_PM can be replaced > with CONFIG_PM_SLEEP or even with CONFIG_SUSPEND, but they can be updated in > the future. There is #ifdef CONFIG_PM around all the .suspend and .resume methods. Technically they are PM_DEVICE_STATES or something, that could really be under PM, and both SUSPEND and HIBERNATE would depend on PM_DEVICE_STATES, but it is also possible to have PM_DEVICE_STATES without SUSPEND and HIBERNATE. oh no, I just suggested more instead of fewer config options:-O but i agree, this can wait a bit... -Len - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 2/2] Introduce CONFIG_SUSPEND
Hi! > > > > > Not only. This also includes "standby". > > > > > > > > Whatever it includes - please tell it to the user in the prompt. > > > > > > > > Technical issues are important, but it's often forgotten how many > > > > problems people run into because the description of a kconfig option > > > > could have been better. > > > > > > Sure. Please see the updated patch I've just sent. :-) > > > > So are you guys using: > > > > "standby" = idle state, ~0.5 seconds > > "suspend" = sleep to ram, ~10 seconds > > "hibernate" = sleep to disk, ~30 seconds > > Something like this, but "suspend" is not reserved as a name of specific > state. > > The second state is usually referred to as "suspend to RAM" or "STR" and is > denoted by "mem" in /sys/power/state, if implemented. Moreover, "standby" and > "mem" are both entered using the same code path, so they may generally be > referred to as "suspend" states. > > The times aren't strictly defined for "mem" and "standby", too. The general > rule is that the times for "mem" are greater then for "standby" and the power > drawn in "mem" is smaller than the power drawn in "standby", but the exact > values will always depend on the platform. Apart from this, if the platform > supports only one "suspend" state, it decides if that's "mem" or "standby". > > On ACPI systems "standby" and "mem" correspond to the S1 and S3 sleep states, > respectively. And I'd expect ~2seconds for both "standby" and "mem" on ACPI system. ACPI S1 is just "for windows ME compatibility, do not use" -- it draws too much power, and is not really faster. Pavel -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 2/2] Introduce CONFIG_SUSPEND
Hi! Not only. This also includes standby. Whatever it includes - please tell it to the user in the prompt. Technical issues are important, but it's often forgotten how many problems people run into because the description of a kconfig option could have been better. Sure. Please see the updated patch I've just sent. :-) So are you guys using: standby = idle state, ~0.5 seconds suspend = sleep to ram, ~10 seconds hibernate = sleep to disk, ~30 seconds Something like this, but suspend is not reserved as a name of specific state. The second state is usually referred to as suspend to RAM or STR and is denoted by mem in /sys/power/state, if implemented. Moreover, standby and mem are both entered using the same code path, so they may generally be referred to as suspend states. The times aren't strictly defined for mem and standby, too. The general rule is that the times for mem are greater then for standby and the power drawn in mem is smaller than the power drawn in standby, but the exact values will always depend on the platform. Apart from this, if the platform supports only one suspend state, it decides if that's mem or standby. On ACPI systems standby and mem correspond to the S1 and S3 sleep states, respectively. And I'd expect ~2seconds for both standby and mem on ACPI system. ACPI S1 is just for windows ME compatibility, do not use -- it draws too much power, and is not really faster. Pavel -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 2/2] Introduce CONFIG_SUSPEND (updated)
On Sunday 29 July 2007 17:27, Rafael J. Wysocki wrote: Still, there are many other files in which CONFIG_PM can be replaced with CONFIG_PM_SLEEP or even with CONFIG_SUSPEND, but they can be updated in the future. There is #ifdef CONFIG_PM around all the .suspend and .resume methods. Technically they are PM_DEVICE_STATES or something, that could really be under PM, and both SUSPEND and HIBERNATE would depend on PM_DEVICE_STATES, but it is also possible to have PM_DEVICE_STATES without SUSPEND and HIBERNATE. oh no, I just suggested more instead of fewer config options:-O but i agree, this can wait a bit... -Len - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 2/2] Introduce CONFIG_SUSPEND
On Jul 29, 2007, at 17:30:40, Richard Hughes wrote: So are you guys using: "standby" = idle state, ~0.5 seconds "suspend" = sleep to ram, ~10 seconds "hibernate" = sleep to disk, ~30 seconds If so - you rock. This is the common nomenclature I've been pushing for a few months now in GNOME, KDE and general userspace. I've written up a spec here: http://cvs.gnome.org/viewcvs/*checkout*/gnome-power-manager/docs/ sleep-names.html Well, those times don't quite work for my PowerBook. If we fixed suspend-to-RAM to reinitialize devices in parallel then it would easily hit 0.5 second transition times, but even now it's only at most 2 seconds. Also once in a while I'll be too hasty plugging my USB devices and manage to hardlock one of the USB busses, but that's an isolated USB driver suspend issue. And it's certainly not called "standby", because the box can literally remain asleep for 7 days on a full charge, versus about 5 hours when just idle with wireless, backlight, and HDD off. Cheers, Kyle Moffett - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 2/2] Introduce CONFIG_SUSPEND
On Sunday, 29 July 2007 23:30, Richard Hughes wrote: > On Sun, 2007-07-29 at 23:36 +0200, Rafael J. Wysocki wrote: > > On Sunday, 29 July 2007 23:18, Adrian Bunk wrote: > > > On Sun, Jul 29, 2007 at 11:17:20PM +0200, Rafael J. Wysocki wrote: > > > > On Sunday, 29 July 2007 22:40, Adrian Bunk wrote: > > > > > On Sun, Jul 29, 2007 at 02:38:05PM +0200, Rafael J. Wysocki wrote: > > > > > >... > > > > > > +config SUSPEND > > > > > > + bool "Suspend" > > > > > "Suspend to RAM" > > > > > > > > Not only. This also includes "standby". > > > > > > Whatever it includes - please tell it to the user in the prompt. > > > > > > Technical issues are important, but it's often forgotten how many > > > problems people run into because the description of a kconfig option > > > could have been better. > > > > Sure. Please see the updated patch I've just sent. :-) > > So are you guys using: > > "standby" = idle state, ~0.5 seconds > "suspend" = sleep to ram, ~10 seconds > "hibernate" = sleep to disk, ~30 seconds Something like this, but "suspend" is not reserved as a name of specific state. The second state is usually referred to as "suspend to RAM" or "STR" and is denoted by "mem" in /sys/power/state, if implemented. Moreover, "standby" and "mem" are both entered using the same code path, so they may generally be referred to as "suspend" states. The times aren't strictly defined for "mem" and "standby", too. The general rule is that the times for "mem" are greater then for "standby" and the power drawn in "mem" is smaller than the power drawn in "standby", but the exact values will always depend on the platform. Apart from this, if the platform supports only one "suspend" state, it decides if that's "mem" or "standby". On ACPI systems "standby" and "mem" correspond to the S1 and S3 sleep states, respectively. Greetings, Rafael -- "Premature optimization is the root of all evil." - Donald Knuth - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 2/2] Introduce CONFIG_SUSPEND
On Sun, 2007-07-29 at 23:36 +0200, Rafael J. Wysocki wrote: > On Sunday, 29 July 2007 23:18, Adrian Bunk wrote: > > On Sun, Jul 29, 2007 at 11:17:20PM +0200, Rafael J. Wysocki wrote: > > > On Sunday, 29 July 2007 22:40, Adrian Bunk wrote: > > > > On Sun, Jul 29, 2007 at 02:38:05PM +0200, Rafael J. Wysocki wrote: > > > > >... > > > > > +config SUSPEND > > > > > + bool "Suspend" > > > > "Suspend to RAM" > > > > > > Not only. This also includes "standby". > > > > Whatever it includes - please tell it to the user in the prompt. > > > > Technical issues are important, but it's often forgotten how many > > problems people run into because the description of a kconfig option > > could have been better. > > Sure. Please see the updated patch I've just sent. :-) So are you guys using: "standby" = idle state, ~0.5 seconds "suspend" = sleep to ram, ~10 seconds "hibernate" = sleep to disk, ~30 seconds If so - you rock. This is the common nomenclature I've been pushing for a few months now in GNOME, KDE and general userspace. I've written up a spec here: http://cvs.gnome.org/viewcvs/*checkout*/gnome-power-manager/docs/sleep-names.html Richard. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 2/2] Introduce CONFIG_SUSPEND
On Sunday, 29 July 2007 23:18, Adrian Bunk wrote: > On Sun, Jul 29, 2007 at 11:17:20PM +0200, Rafael J. Wysocki wrote: > > On Sunday, 29 July 2007 22:40, Adrian Bunk wrote: > > > On Sun, Jul 29, 2007 at 02:38:05PM +0200, Rafael J. Wysocki wrote: > > > >... > > > > +config SUSPEND > > > > + bool "Suspend" > > > "Suspend to RAM" > > > > Not only. This also includes "standby". > > Whatever it includes - please tell it to the user in the prompt. > > Technical issues are important, but it's often forgotten how many > problems people run into because the description of a kconfig option > could have been better. Sure. Please see the updated patch I've just sent. :-) Greetings, Rafael - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 2/2] Introduce CONFIG_SUSPEND (updated)
From: Rafael J. Wysocki <[EMAIL PROTECTED]> Introduce CONFIG_SUSPEND representing the ability to enter system sleep states, such as the ACPI S3 state, and allow the user to choose SUSPEND and HIBERNATION independently of each other. Make HOTPLUG_CPU be selected automatically if SUSPEND or HIBERNATION has been chosen and the kernel is intended for SMP systems. Also, introduce CONFIG_PM_SLEEP which is automatically selected if CONFIG_SUSPEND or CONFIG_HIBERNATION is set and use it to select the code needed for both suspend and hibernation. The top-level power management headers and the ACPI code related to suspend and hibernation are modified to use the new definitions (the changes in drivers/acpi/sleep/main.c are, mostly, moving code to reduce the number of ifdefs). Still, there are many other files in which CONFIG_PM can be replaced with CONFIG_PM_SLEEP or even with CONFIG_SUSPEND, but they can be updated in the future. Signed-off-by: Rafael J. Wysocki <[EMAIL PROTECTED]> --- drivers/acpi/Kconfig|8 +++ drivers/acpi/sleep/Makefile |2 drivers/acpi/sleep/main.c | 94 +++- drivers/acpi/sleep/proc.c | 10 ++-- drivers/acpi/sleep/sleep.h |2 drivers/base/power/Makefile |2 drivers/base/power/power.h |4 - include/acpi/acpi_bus.h |9 include/acpi/acpi_drivers.h |4 + include/linux/freezer.h |6 +- include/linux/pm.h | 15 +-- include/linux/suspend.h | 10 ++-- kernel/power/Kconfig| 39 ++ kernel/power/Makefile |3 - kernel/power/main.c | 26 kernel/power/power.h| 10 mm/page_alloc.c |4 - 17 files changed, 163 insertions(+), 85 deletions(-) Index: linux-2.6/kernel/power/Kconfig === --- linux-2.6.orig/kernel/power/Kconfig 2007-07-29 19:06:26.0 +0200 +++ linux-2.6/kernel/power/Kconfig 2007-07-29 19:06:48.0 +0200 @@ -46,7 +46,7 @@ config PM_VERBOSE config DISABLE_CONSOLE_SUSPEND bool "Keep console(s) enabled during suspend/resume (DANGEROUS)" - depends on PM_DEBUG + depends on PM_DEBUG && PM_SLEEP default n ---help--- This option turns off the console suspend mechanism that prevents @@ -57,7 +57,7 @@ config DISABLE_CONSOLE_SUSPEND config PM_TRACE bool "Suspend/resume event tracing" - depends on PM_DEBUG && X86 && EXPERIMENTAL + depends on PM_DEBUG && X86 && PM_SLEEP && EXPERIMENTAL default n ---help--- This enables some cheesy code to save the last PM event point in the @@ -72,9 +72,37 @@ config PM_TRACE CAUTION: this option will cause your machine's real-time clock to be set to an invalid time after a resume. +config SUSPEND_SMP_POSSIBLE + bool + depends on (X86 && !X86_VOYAGER) || (PPC64 && (PPC_PSERIES || PPC_PMAC)) + depends on SMP + default y + +config SUSPEND_SMP + bool + depends on SUSPEND_SMP_POSSIBLE && PM_SLEEP + select HOTPLUG_CPU + default y + +config PM_SLEEP + bool + depends on SUSPEND || HIBERNATION + default y + +config SUSPEND + bool "Suspend to RAM and standby" + depends on PM + depends on !SMP || SUSPEND_SMP_POSSIBLE + default y + ---help--- + Allow the system to enter sleep states in which main memory is + powered and thus its contents are preserved, such as the + suspend-to-RAM state (i.e. the ACPI S3 state). + config HIBERNATION bool "Hibernation" - depends on PM && SWAP && (((X86 || PPC64_SWSUSP) && (!SMP || SUSPEND_SMP)) || ((FRV || PPC32) && !SMP)) + depends on PM && SWAP + depends on ((X86 || PPC64_SWSUSP || FRV || PPC32) && !SMP) || SUSPEND_SMP_POSSIBLE ---help--- Enable the suspend to disk (STD) functionality, which is usually called "hibernation" in user interfaces. STD checkpoints the @@ -132,11 +160,6 @@ config PM_STD_PARTITION suspended image to. It will simply pick the first available swap device. -config SUSPEND_SMP - bool - depends on HOTPLUG_CPU && (X86 || PPC64) && PM - default y - config APM_EMULATION tristate "Advanced Power Management Emulation" depends on PM && SYS_SUPPORTS_APM_EMULATION Index: linux-2.6/kernel/power/Makefile === --- linux-2.6.orig/kernel/power/Makefile2007-07-29 19:06:26.0 +0200 +++ linux-2.6/kernel/power/Makefile 2007-07-29 19:06:48.0 +0200 @@ -3,8 +3,9 @@ ifeq ($(CONFIG_PM_DEBUG),y) EXTRA_CFLAGS += -DDEBUG endif -obj-y := main.o process.o console.o +obj-y := main.o obj-$(CONFIG_PM_LEGACY)+= pm.o +obj-$(CONFIG_PM_SLEEP) += process.o
Re: [PATCH 2/2] Introduce CONFIG_SUSPEND
On Sun, Jul 29, 2007 at 11:17:20PM +0200, Rafael J. Wysocki wrote: > On Sunday, 29 July 2007 22:40, Adrian Bunk wrote: > > On Sun, Jul 29, 2007 at 02:38:05PM +0200, Rafael J. Wysocki wrote: > > >... > > > +config SUSPEND > > > + bool "Suspend" > > "Suspend to RAM" > > Not only. This also includes "standby". Whatever it includes - please tell it to the user in the prompt. Technical issues are important, but it's often forgotten how many problems people run into because the description of a kconfig option could have been better. > > >... > > > config HIBERNATION > > > bool "Hibernation" > > >... "Hibernation (Suspend to disk)" > > > > cu > > Adrian > > Greetings, > Rafael > > > -- > "Premature optimization is the root of all evil." - Donald Knuth cu Adrian -- "Is there not promise of rain?" Ling Tan asked suddenly out of the darkness. There had been need of rain for many days. "Only a promise," Lao Er said. Pearl S. Buck - Dragon Seed - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 2/2] Introduce CONFIG_SUSPEND
On Sunday, 29 July 2007 22:40, Adrian Bunk wrote: > On Sun, Jul 29, 2007 at 02:38:05PM +0200, Rafael J. Wysocki wrote: > >... > > +config SUSPEND > > + bool "Suspend" > "Suspend to RAM" Not only. This also includes "standby". > >... > > config HIBERNATION > > bool "Hibernation" > >... "Hibernation (Suspend to disk)" > > cu > Adrian Greetings, Rafael -- "Premature optimization is the root of all evil." - Donald Knuth - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 2/2] Introduce CONFIG_SUSPEND
On Sun, Jul 29, 2007 at 02:38:05PM +0200, Rafael J. Wysocki wrote: >... > +config SUSPEND > + bool "Suspend" "Suspend to RAM" >... > config HIBERNATION > bool "Hibernation" >... "Hibernation (Suspend to disk)" cu Adrian -- "Is there not promise of rain?" Ling Tan asked suddenly out of the darkness. There had been need of rain for many days. "Only a promise," Lao Er said. Pearl S. Buck - Dragon Seed - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 2/2] Introduce CONFIG_SUSPEND
From: Rafael J. Wysocki <[EMAIL PROTECTED]> Introduce CONFIG_SUSPEND representing the ability to enter system sleep states, such as the ACPI S3 state, and allow the user to choose SUSPEND and HIBERNATION independently of each other. Make HOTPLUG_CPU be selected automatically if SUSPEND or HIBERNATION has been chosen and the kernel is intended for SMP systems. Also, introduce CONFIG_PM_SLEEP which is automatically selected if CONFIG_SUSPEND or CONFIG_HIBERNATION is set and make CONFIG_ACPI_SLEEP depend on it. The top-level power management headers are modified to use the new definitions. Still, there are many other files in which CONFIG_PM can be replaced with CONFIG_PM_SLEEP or even with CONFIG_SUSPEND, but they can be updated in the future. Signed-off-by: Rafael J. Wysocki <[EMAIL PROTECTED]> --- drivers/acpi/Kconfig|2 +- drivers/base/power/Makefile |6 +++--- drivers/base/power/power.h |4 ++-- include/acpi/acpi_bus.h |7 +++ include/linux/freezer.h |6 +++--- include/linux/pm.h |8 include/linux/suspend.h | 16 kernel/power/Kconfig| 39 +++ kernel/power/Makefile |3 ++- kernel/power/main.c | 26 ++ kernel/power/power.h| 10 +- mm/page_alloc.c |4 ++-- 12 files changed, 90 insertions(+), 41 deletions(-) Index: linux-2.6.23-rc1/kernel/power/Kconfig === --- linux-2.6.23-rc1.orig/kernel/power/Kconfig 2007-07-29 11:05:14.0 +0200 +++ linux-2.6.23-rc1/kernel/power/Kconfig 2007-07-29 11:18:49.0 +0200 @@ -46,7 +46,7 @@ config PM_VERBOSE config DISABLE_CONSOLE_SUSPEND bool "Keep console(s) enabled during suspend/resume (DANGEROUS)" - depends on PM_DEBUG + depends on PM_DEBUG && PM_SLEEP default n ---help--- This option turns off the console suspend mechanism that prevents @@ -57,7 +57,7 @@ config DISABLE_CONSOLE_SUSPEND config PM_TRACE bool "Suspend/resume event tracing" - depends on PM_DEBUG && X86 && EXPERIMENTAL + depends on PM_DEBUG && X86 && PM_SLEEP && EXPERIMENTAL default n ---help--- This enables some cheesy code to save the last PM event point in the @@ -72,9 +72,37 @@ config PM_TRACE CAUTION: this option will cause your machine's real-time clock to be set to an invalid time after a resume. +config SUSPEND_SMP_POSSIBLE + bool + depends on (X86 && !X86_VOYAGER) || (PPC64 && (PPC_PSERIES || PPC_PMAC)) + depends on SMP + default y + +config SUSPEND_SMP + bool + depends on SUSPEND_SMP_POSSIBLE && PM_SLEEP + select HOTPLUG_CPU + default y + +config PM_SLEEP + bool + depends on SUSPEND || HIBERNATION + default y + +config SUSPEND + bool "Suspend" + depends on PM + depends on !SMP || SUSPEND_SMP_POSSIBLE + default y + ---help--- + Allow the system to enter sleep states in which main memory is + powered and thus its contents are preserved, such as the + suspend-to-RAM state (i.e. the ACPI S3 state). + config HIBERNATION bool "Hibernation" - depends on PM && SWAP && (((X86 || PPC64_SWSUSP) && (!SMP || SUSPEND_SMP)) || ((FRV || PPC32) && !SMP)) + depends on PM && SWAP + depends on ((X86 || PPC64_SWSUSP || FRV || PPC32) && !SMP) || SUSPEND_SMP_POSSIBLE ---help--- Enable the suspend to disk (STD) functionality, which is usually called "hibernation" in user interfaces. STD checkpoints the @@ -132,11 +160,6 @@ config PM_STD_PARTITION suspended image to. It will simply pick the first available swap device. -config SUSPEND_SMP - bool - depends on HOTPLUG_CPU && (X86 || PPC64) && PM - default y - config APM_EMULATION tristate "Advanced Power Management Emulation" depends on PM && SYS_SUPPORTS_APM_EMULATION Index: linux-2.6.23-rc1/kernel/power/Makefile === --- linux-2.6.23-rc1.orig/kernel/power/Makefile 2007-07-29 11:05:14.0 +0200 +++ linux-2.6.23-rc1/kernel/power/Makefile 2007-07-29 12:53:13.0 +0200 @@ -3,8 +3,9 @@ ifeq ($(CONFIG_PM_DEBUG),y) EXTRA_CFLAGS += -DDEBUG endif -obj-y := main.o process.o console.o +obj-y := main.o obj-$(CONFIG_PM_LEGACY)+= pm.o +obj-$(CONFIG_PM_SLEEP) += process.o console.o obj-$(CONFIG_HIBERNATION) += swsusp.o disk.o snapshot.o swap.o user.o obj-$(CONFIG_MAGIC_SYSRQ) += poweroff.o Index: linux-2.6.23-rc1/drivers/base/power/Makefile === --- linux-2.6.23-rc1.orig/drivers/base/power/Makefile 2007-07-29
[PATCH 2/2] Introduce CONFIG_SUSPEND
From: Rafael J. Wysocki [EMAIL PROTECTED] Introduce CONFIG_SUSPEND representing the ability to enter system sleep states, such as the ACPI S3 state, and allow the user to choose SUSPEND and HIBERNATION independently of each other. Make HOTPLUG_CPU be selected automatically if SUSPEND or HIBERNATION has been chosen and the kernel is intended for SMP systems. Also, introduce CONFIG_PM_SLEEP which is automatically selected if CONFIG_SUSPEND or CONFIG_HIBERNATION is set and make CONFIG_ACPI_SLEEP depend on it. The top-level power management headers are modified to use the new definitions. Still, there are many other files in which CONFIG_PM can be replaced with CONFIG_PM_SLEEP or even with CONFIG_SUSPEND, but they can be updated in the future. Signed-off-by: Rafael J. Wysocki [EMAIL PROTECTED] --- drivers/acpi/Kconfig|2 +- drivers/base/power/Makefile |6 +++--- drivers/base/power/power.h |4 ++-- include/acpi/acpi_bus.h |7 +++ include/linux/freezer.h |6 +++--- include/linux/pm.h |8 include/linux/suspend.h | 16 kernel/power/Kconfig| 39 +++ kernel/power/Makefile |3 ++- kernel/power/main.c | 26 ++ kernel/power/power.h| 10 +- mm/page_alloc.c |4 ++-- 12 files changed, 90 insertions(+), 41 deletions(-) Index: linux-2.6.23-rc1/kernel/power/Kconfig === --- linux-2.6.23-rc1.orig/kernel/power/Kconfig 2007-07-29 11:05:14.0 +0200 +++ linux-2.6.23-rc1/kernel/power/Kconfig 2007-07-29 11:18:49.0 +0200 @@ -46,7 +46,7 @@ config PM_VERBOSE config DISABLE_CONSOLE_SUSPEND bool Keep console(s) enabled during suspend/resume (DANGEROUS) - depends on PM_DEBUG + depends on PM_DEBUG PM_SLEEP default n ---help--- This option turns off the console suspend mechanism that prevents @@ -57,7 +57,7 @@ config DISABLE_CONSOLE_SUSPEND config PM_TRACE bool Suspend/resume event tracing - depends on PM_DEBUG X86 EXPERIMENTAL + depends on PM_DEBUG X86 PM_SLEEP EXPERIMENTAL default n ---help--- This enables some cheesy code to save the last PM event point in the @@ -72,9 +72,37 @@ config PM_TRACE CAUTION: this option will cause your machine's real-time clock to be set to an invalid time after a resume. +config SUSPEND_SMP_POSSIBLE + bool + depends on (X86 !X86_VOYAGER) || (PPC64 (PPC_PSERIES || PPC_PMAC)) + depends on SMP + default y + +config SUSPEND_SMP + bool + depends on SUSPEND_SMP_POSSIBLE PM_SLEEP + select HOTPLUG_CPU + default y + +config PM_SLEEP + bool + depends on SUSPEND || HIBERNATION + default y + +config SUSPEND + bool Suspend + depends on PM + depends on !SMP || SUSPEND_SMP_POSSIBLE + default y + ---help--- + Allow the system to enter sleep states in which main memory is + powered and thus its contents are preserved, such as the + suspend-to-RAM state (i.e. the ACPI S3 state). + config HIBERNATION bool Hibernation - depends on PM SWAP (((X86 || PPC64_SWSUSP) (!SMP || SUSPEND_SMP)) || ((FRV || PPC32) !SMP)) + depends on PM SWAP + depends on ((X86 || PPC64_SWSUSP || FRV || PPC32) !SMP) || SUSPEND_SMP_POSSIBLE ---help--- Enable the suspend to disk (STD) functionality, which is usually called hibernation in user interfaces. STD checkpoints the @@ -132,11 +160,6 @@ config PM_STD_PARTITION suspended image to. It will simply pick the first available swap device. -config SUSPEND_SMP - bool - depends on HOTPLUG_CPU (X86 || PPC64) PM - default y - config APM_EMULATION tristate Advanced Power Management Emulation depends on PM SYS_SUPPORTS_APM_EMULATION Index: linux-2.6.23-rc1/kernel/power/Makefile === --- linux-2.6.23-rc1.orig/kernel/power/Makefile 2007-07-29 11:05:14.0 +0200 +++ linux-2.6.23-rc1/kernel/power/Makefile 2007-07-29 12:53:13.0 +0200 @@ -3,8 +3,9 @@ ifeq ($(CONFIG_PM_DEBUG),y) EXTRA_CFLAGS += -DDEBUG endif -obj-y := main.o process.o console.o +obj-y := main.o obj-$(CONFIG_PM_LEGACY)+= pm.o +obj-$(CONFIG_PM_SLEEP) += process.o console.o obj-$(CONFIG_HIBERNATION) += swsusp.o disk.o snapshot.o swap.o user.o obj-$(CONFIG_MAGIC_SYSRQ) += poweroff.o Index: linux-2.6.23-rc1/drivers/base/power/Makefile === --- linux-2.6.23-rc1.orig/drivers/base/power/Makefile 2007-07-29 11:05:14.0 +0200 +++
Re: [PATCH 2/2] Introduce CONFIG_SUSPEND
On Sun, Jul 29, 2007 at 02:38:05PM +0200, Rafael J. Wysocki wrote: ... +config SUSPEND + bool Suspend Suspend to RAM ... config HIBERNATION bool Hibernation ... Hibernation (Suspend to disk) cu Adrian -- Is there not promise of rain? Ling Tan asked suddenly out of the darkness. There had been need of rain for many days. Only a promise, Lao Er said. Pearl S. Buck - Dragon Seed - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 2/2] Introduce CONFIG_SUSPEND
On Sunday, 29 July 2007 22:40, Adrian Bunk wrote: On Sun, Jul 29, 2007 at 02:38:05PM +0200, Rafael J. Wysocki wrote: ... +config SUSPEND + bool Suspend Suspend to RAM Not only. This also includes standby. ... config HIBERNATION bool Hibernation ... Hibernation (Suspend to disk) cu Adrian Greetings, Rafael -- Premature optimization is the root of all evil. - Donald Knuth - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 2/2] Introduce CONFIG_SUSPEND
On Sun, Jul 29, 2007 at 11:17:20PM +0200, Rafael J. Wysocki wrote: On Sunday, 29 July 2007 22:40, Adrian Bunk wrote: On Sun, Jul 29, 2007 at 02:38:05PM +0200, Rafael J. Wysocki wrote: ... +config SUSPEND + bool Suspend Suspend to RAM Not only. This also includes standby. Whatever it includes - please tell it to the user in the prompt. Technical issues are important, but it's often forgotten how many problems people run into because the description of a kconfig option could have been better. ... config HIBERNATION bool Hibernation ... Hibernation (Suspend to disk) cu Adrian Greetings, Rafael -- Premature optimization is the root of all evil. - Donald Knuth cu Adrian -- Is there not promise of rain? Ling Tan asked suddenly out of the darkness. There had been need of rain for many days. Only a promise, Lao Er said. Pearl S. Buck - Dragon Seed - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 2/2] Introduce CONFIG_SUSPEND (updated)
From: Rafael J. Wysocki [EMAIL PROTECTED] Introduce CONFIG_SUSPEND representing the ability to enter system sleep states, such as the ACPI S3 state, and allow the user to choose SUSPEND and HIBERNATION independently of each other. Make HOTPLUG_CPU be selected automatically if SUSPEND or HIBERNATION has been chosen and the kernel is intended for SMP systems. Also, introduce CONFIG_PM_SLEEP which is automatically selected if CONFIG_SUSPEND or CONFIG_HIBERNATION is set and use it to select the code needed for both suspend and hibernation. The top-level power management headers and the ACPI code related to suspend and hibernation are modified to use the new definitions (the changes in drivers/acpi/sleep/main.c are, mostly, moving code to reduce the number of ifdefs). Still, there are many other files in which CONFIG_PM can be replaced with CONFIG_PM_SLEEP or even with CONFIG_SUSPEND, but they can be updated in the future. Signed-off-by: Rafael J. Wysocki [EMAIL PROTECTED] --- drivers/acpi/Kconfig|8 +++ drivers/acpi/sleep/Makefile |2 drivers/acpi/sleep/main.c | 94 +++- drivers/acpi/sleep/proc.c | 10 ++-- drivers/acpi/sleep/sleep.h |2 drivers/base/power/Makefile |2 drivers/base/power/power.h |4 - include/acpi/acpi_bus.h |9 include/acpi/acpi_drivers.h |4 + include/linux/freezer.h |6 +- include/linux/pm.h | 15 +-- include/linux/suspend.h | 10 ++-- kernel/power/Kconfig| 39 ++ kernel/power/Makefile |3 - kernel/power/main.c | 26 kernel/power/power.h| 10 mm/page_alloc.c |4 - 17 files changed, 163 insertions(+), 85 deletions(-) Index: linux-2.6/kernel/power/Kconfig === --- linux-2.6.orig/kernel/power/Kconfig 2007-07-29 19:06:26.0 +0200 +++ linux-2.6/kernel/power/Kconfig 2007-07-29 19:06:48.0 +0200 @@ -46,7 +46,7 @@ config PM_VERBOSE config DISABLE_CONSOLE_SUSPEND bool Keep console(s) enabled during suspend/resume (DANGEROUS) - depends on PM_DEBUG + depends on PM_DEBUG PM_SLEEP default n ---help--- This option turns off the console suspend mechanism that prevents @@ -57,7 +57,7 @@ config DISABLE_CONSOLE_SUSPEND config PM_TRACE bool Suspend/resume event tracing - depends on PM_DEBUG X86 EXPERIMENTAL + depends on PM_DEBUG X86 PM_SLEEP EXPERIMENTAL default n ---help--- This enables some cheesy code to save the last PM event point in the @@ -72,9 +72,37 @@ config PM_TRACE CAUTION: this option will cause your machine's real-time clock to be set to an invalid time after a resume. +config SUSPEND_SMP_POSSIBLE + bool + depends on (X86 !X86_VOYAGER) || (PPC64 (PPC_PSERIES || PPC_PMAC)) + depends on SMP + default y + +config SUSPEND_SMP + bool + depends on SUSPEND_SMP_POSSIBLE PM_SLEEP + select HOTPLUG_CPU + default y + +config PM_SLEEP + bool + depends on SUSPEND || HIBERNATION + default y + +config SUSPEND + bool Suspend to RAM and standby + depends on PM + depends on !SMP || SUSPEND_SMP_POSSIBLE + default y + ---help--- + Allow the system to enter sleep states in which main memory is + powered and thus its contents are preserved, such as the + suspend-to-RAM state (i.e. the ACPI S3 state). + config HIBERNATION bool Hibernation - depends on PM SWAP (((X86 || PPC64_SWSUSP) (!SMP || SUSPEND_SMP)) || ((FRV || PPC32) !SMP)) + depends on PM SWAP + depends on ((X86 || PPC64_SWSUSP || FRV || PPC32) !SMP) || SUSPEND_SMP_POSSIBLE ---help--- Enable the suspend to disk (STD) functionality, which is usually called hibernation in user interfaces. STD checkpoints the @@ -132,11 +160,6 @@ config PM_STD_PARTITION suspended image to. It will simply pick the first available swap device. -config SUSPEND_SMP - bool - depends on HOTPLUG_CPU (X86 || PPC64) PM - default y - config APM_EMULATION tristate Advanced Power Management Emulation depends on PM SYS_SUPPORTS_APM_EMULATION Index: linux-2.6/kernel/power/Makefile === --- linux-2.6.orig/kernel/power/Makefile2007-07-29 19:06:26.0 +0200 +++ linux-2.6/kernel/power/Makefile 2007-07-29 19:06:48.0 +0200 @@ -3,8 +3,9 @@ ifeq ($(CONFIG_PM_DEBUG),y) EXTRA_CFLAGS += -DDEBUG endif -obj-y := main.o process.o console.o +obj-y := main.o obj-$(CONFIG_PM_LEGACY)+= pm.o +obj-$(CONFIG_PM_SLEEP) += process.o console.o obj-$(CONFIG_HIBERNATION) +=
Re: [PATCH 2/2] Introduce CONFIG_SUSPEND
On Sunday, 29 July 2007 23:18, Adrian Bunk wrote: On Sun, Jul 29, 2007 at 11:17:20PM +0200, Rafael J. Wysocki wrote: On Sunday, 29 July 2007 22:40, Adrian Bunk wrote: On Sun, Jul 29, 2007 at 02:38:05PM +0200, Rafael J. Wysocki wrote: ... +config SUSPEND + bool Suspend Suspend to RAM Not only. This also includes standby. Whatever it includes - please tell it to the user in the prompt. Technical issues are important, but it's often forgotten how many problems people run into because the description of a kconfig option could have been better. Sure. Please see the updated patch I've just sent. :-) Greetings, Rafael - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 2/2] Introduce CONFIG_SUSPEND
On Sun, 2007-07-29 at 23:36 +0200, Rafael J. Wysocki wrote: On Sunday, 29 July 2007 23:18, Adrian Bunk wrote: On Sun, Jul 29, 2007 at 11:17:20PM +0200, Rafael J. Wysocki wrote: On Sunday, 29 July 2007 22:40, Adrian Bunk wrote: On Sun, Jul 29, 2007 at 02:38:05PM +0200, Rafael J. Wysocki wrote: ... +config SUSPEND + bool Suspend Suspend to RAM Not only. This also includes standby. Whatever it includes - please tell it to the user in the prompt. Technical issues are important, but it's often forgotten how many problems people run into because the description of a kconfig option could have been better. Sure. Please see the updated patch I've just sent. :-) So are you guys using: standby = idle state, ~0.5 seconds suspend = sleep to ram, ~10 seconds hibernate = sleep to disk, ~30 seconds If so - you rock. This is the common nomenclature I've been pushing for a few months now in GNOME, KDE and general userspace. I've written up a spec here: http://cvs.gnome.org/viewcvs/*checkout*/gnome-power-manager/docs/sleep-names.html Richard. - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 2/2] Introduce CONFIG_SUSPEND
On Sunday, 29 July 2007 23:30, Richard Hughes wrote: On Sun, 2007-07-29 at 23:36 +0200, Rafael J. Wysocki wrote: On Sunday, 29 July 2007 23:18, Adrian Bunk wrote: On Sun, Jul 29, 2007 at 11:17:20PM +0200, Rafael J. Wysocki wrote: On Sunday, 29 July 2007 22:40, Adrian Bunk wrote: On Sun, Jul 29, 2007 at 02:38:05PM +0200, Rafael J. Wysocki wrote: ... +config SUSPEND + bool Suspend Suspend to RAM Not only. This also includes standby. Whatever it includes - please tell it to the user in the prompt. Technical issues are important, but it's often forgotten how many problems people run into because the description of a kconfig option could have been better. Sure. Please see the updated patch I've just sent. :-) So are you guys using: standby = idle state, ~0.5 seconds suspend = sleep to ram, ~10 seconds hibernate = sleep to disk, ~30 seconds Something like this, but suspend is not reserved as a name of specific state. The second state is usually referred to as suspend to RAM or STR and is denoted by mem in /sys/power/state, if implemented. Moreover, standby and mem are both entered using the same code path, so they may generally be referred to as suspend states. The times aren't strictly defined for mem and standby, too. The general rule is that the times for mem are greater then for standby and the power drawn in mem is smaller than the power drawn in standby, but the exact values will always depend on the platform. Apart from this, if the platform supports only one suspend state, it decides if that's mem or standby. On ACPI systems standby and mem correspond to the S1 and S3 sleep states, respectively. Greetings, Rafael -- Premature optimization is the root of all evil. - Donald Knuth - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 2/2] Introduce CONFIG_SUSPEND
On Jul 29, 2007, at 17:30:40, Richard Hughes wrote: So are you guys using: standby = idle state, ~0.5 seconds suspend = sleep to ram, ~10 seconds hibernate = sleep to disk, ~30 seconds If so - you rock. This is the common nomenclature I've been pushing for a few months now in GNOME, KDE and general userspace. I've written up a spec here: http://cvs.gnome.org/viewcvs/*checkout*/gnome-power-manager/docs/ sleep-names.html Well, those times don't quite work for my PowerBook. If we fixed suspend-to-RAM to reinitialize devices in parallel then it would easily hit 0.5 second transition times, but even now it's only at most 2 seconds. Also once in a while I'll be too hasty plugging my USB devices and manage to hardlock one of the USB busses, but that's an isolated USB driver suspend issue. And it's certainly not called standby, because the box can literally remain asleep for 7 days on a full charge, versus about 5 hours when just idle with wireless, backlight, and HDD off. Cheers, Kyle Moffett - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/