linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] PM / suspend: Always use deepest C-state in the "freeze" sleep state
@ 2014-05-04 22:51 Rafael J. Wysocki
  2014-05-05 12:46 ` Li, Aubrey
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Rafael J. Wysocki @ 2014-05-04 22:51 UTC (permalink / raw)
  To: Linux PM list
  Cc: Linux Kernel Mailing List, Daniel Lezcano, Zhang Rui, Aubrey Li

From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

If freeze_enter() is called, we want to bypass the current cpuidle
governor and always use the deepest available (that is, not disabled)
C-state, because we want to save as much energy as reasonably possible
then and runtime latency constraints don't matter at that point, since
the system is in a sleep state anyway.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---

This is on top of https://patchwork.kernel.org/patch/4071541/ .

---
 drivers/cpuidle/cpuidle.c |   45 ++++++++++++++++++++++++++++++++++++++++++++-
 include/linux/cpuidle.h   |    2 ++
 kernel/power/suspend.c    |    2 ++
 3 files changed, 48 insertions(+), 1 deletion(-)

Index: linux-pm/drivers/cpuidle/cpuidle.c
===================================================================
--- linux-pm.orig/drivers/cpuidle/cpuidle.c
+++ linux-pm/drivers/cpuidle/cpuidle.c
@@ -32,6 +32,7 @@ LIST_HEAD(cpuidle_detected_devices);
 static int enabled_devices;
 static int off __read_mostly;
 static int initialized __read_mostly;
+static bool use_deepest_state __read_mostly;
 
 int cpuidle_disabled(void)
 {
@@ -65,6 +66,45 @@ int cpuidle_play_dead(void)
 }
 
 /**
+ * cpuidle_use_deepest_state - Enable/disable the "deepest idle" mode.
+ * @enable: Whether enable or disable the feature.
+ *
+ * If the "deepest idle" mode is enabled, cpuidle will ignore the governor and
+ * always use the state with the greatest exit latency (out of the states that
+ * are not disabled).
+ *
+ * This function can only be called after cpuidle_pause() to avoid races.
+ */
+void cpuidle_use_deepest_state(bool enable)
+{
+	use_deepest_state = enable;
+}
+
+/**
+ * cpuidle_find_deepest_state - Find the state of the greatest exit latency.
+ * @drv: cpuidle driver for a given CPU.
+ * @dev: cpuidle device for a given CPU.
+ */
+static int cpuidle_find_deepest_state(struct cpuidle_driver *drv,
+				      struct cpuidle_device *dev)
+{
+	unsigned int latency_req = 0;
+	int i, ret = CPUIDLE_DRIVER_STATE_START - 1;
+
+	for (i = CPUIDLE_DRIVER_STATE_START; i < drv->state_count; i++) {
+		struct cpuidle_state *s = &drv->states[i];
+		struct cpuidle_state_usage *su = &dev->states_usage[i];
+
+		if (s->disabled || su->disable || s->exit_latency <= latency_req)
+			continue;
+
+		latency_req = s->exit_latency;
+		ret = i;
+	}
+	return ret;
+}
+
+/**
  * cpuidle_enter_state - enter the state and update stats
  * @dev: cpuidle device for this cpu
  * @drv: cpuidle driver for this cpu
@@ -124,6 +164,9 @@ int cpuidle_select(struct cpuidle_driver
 	if (!drv || !dev || !dev->enabled)
 		return -EBUSY;
 
+	if (unlikely(use_deepest_state))
+		return cpuidle_find_deepest_state(drv, dev);
+
 	return cpuidle_curr_governor->select(drv, dev);
 }
 
@@ -155,7 +198,7 @@ int cpuidle_enter(struct cpuidle_driver
  */
 void cpuidle_reflect(struct cpuidle_device *dev, int index)
 {
-	if (cpuidle_curr_governor->reflect)
+	if (cpuidle_curr_governor->reflect && !unlikely(use_deepest_state))
 		cpuidle_curr_governor->reflect(dev, index);
 }
 
Index: linux-pm/include/linux/cpuidle.h
===================================================================
--- linux-pm.orig/include/linux/cpuidle.h
+++ linux-pm/include/linux/cpuidle.h
@@ -143,6 +143,7 @@ extern void cpuidle_resume(void);
 extern int cpuidle_enable_device(struct cpuidle_device *dev);
 extern void cpuidle_disable_device(struct cpuidle_device *dev);
 extern int cpuidle_play_dead(void);
+extern void cpuidle_use_deepest_state(bool enable);
 
 extern struct cpuidle_driver *cpuidle_get_cpu_driver(struct cpuidle_device *dev);
 #else
@@ -175,6 +176,7 @@ static inline int cpuidle_enable_device(
 {return -ENODEV; }
 static inline void cpuidle_disable_device(struct cpuidle_device *dev) { }
 static inline int cpuidle_play_dead(void) {return -ENODEV; }
+static inline void cpuidle_use_deepest_state(bool enable) {}
 static inline struct cpuidle_driver *cpuidle_get_cpu_driver(
 	struct cpuidle_device *dev) {return NULL; }
 #endif
Index: linux-pm/kernel/power/suspend.c
===================================================================
--- linux-pm.orig/kernel/power/suspend.c
+++ linux-pm/kernel/power/suspend.c
@@ -54,9 +54,11 @@ static void freeze_begin(void)
 
 static void freeze_enter(void)
 {
+	cpuidle_use_deepest_state(true);
 	cpuidle_resume();
 	wait_event(suspend_freeze_wait_head, suspend_freeze_wake);
 	cpuidle_pause();
+	cpuidle_use_deepest_state(false);
 }
 
 void freeze_wake(void)

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] PM / suspend: Always use deepest C-state in the "freeze" sleep state
  2014-05-04 22:51 [PATCH] PM / suspend: Always use deepest C-state in the "freeze" sleep state Rafael J. Wysocki
@ 2014-05-05 12:46 ` Li, Aubrey
  2014-05-09  7:38 ` Pavel Machek
  2014-05-12 14:08 ` Daniel Lezcano
  2 siblings, 0 replies; 10+ messages in thread
From: Li, Aubrey @ 2014-05-05 12:46 UTC (permalink / raw)
  To: Rafael J. Wysocki, Linux PM list
  Cc: Linux Kernel Mailing List, Daniel Lezcano, Zhang Rui, Aubrey Li

On 2014/5/5 6:51, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> 
> If freeze_enter() is called, we want to bypass the current cpuidle
> governor and always use the deepest available (that is, not disabled)
> C-state, because we want to save as much energy as reasonably possible
> then and runtime latency constraints don't matter at that point, since
> the system is in a sleep state anyway.
> 
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> ---
> 
> This is on top of https://patchwork.kernel.org/patch/4071541/ .
> 
> ---
>  drivers/cpuidle/cpuidle.c |   45 ++++++++++++++++++++++++++++++++++++++++++++-
>  include/linux/cpuidle.h   |    2 ++
>  kernel/power/suspend.c    |    2 ++
>  3 files changed, 48 insertions(+), 1 deletion(-)
> 
> Index: linux-pm/drivers/cpuidle/cpuidle.c
> ===================================================================
> --- linux-pm.orig/drivers/cpuidle/cpuidle.c
> +++ linux-pm/drivers/cpuidle/cpuidle.c
> @@ -32,6 +32,7 @@ LIST_HEAD(cpuidle_detected_devices);
>  static int enabled_devices;
>  static int off __read_mostly;
>  static int initialized __read_mostly;
> +static bool use_deepest_state __read_mostly;
>  
>  int cpuidle_disabled(void)
>  {
> @@ -65,6 +66,45 @@ int cpuidle_play_dead(void)
>  }
>  
>  /**
> + * cpuidle_use_deepest_state - Enable/disable the "deepest idle" mode.
> + * @enable: Whether enable or disable the feature.
> + *
> + * If the "deepest idle" mode is enabled, cpuidle will ignore the governor and
> + * always use the state with the greatest exit latency (out of the states that
> + * are not disabled).
> + *
> + * This function can only be called after cpuidle_pause() to avoid races.
> + */
> +void cpuidle_use_deepest_state(bool enable)
> +{
> +	use_deepest_state = enable;
> +}
> +
> +/**
> + * cpuidle_find_deepest_state - Find the state of the greatest exit latency.
> + * @drv: cpuidle driver for a given CPU.
> + * @dev: cpuidle device for a given CPU.
> + */
> +static int cpuidle_find_deepest_state(struct cpuidle_driver *drv,
> +				      struct cpuidle_device *dev)
> +{
> +	unsigned int latency_req = 0;
> +	int i, ret = CPUIDLE_DRIVER_STATE_START - 1;
> +
> +	for (i = CPUIDLE_DRIVER_STATE_START; i < drv->state_count; i++) {
> +		struct cpuidle_state *s = &drv->states[i];
> +		struct cpuidle_state_usage *su = &dev->states_usage[i];
> +
> +		if (s->disabled || su->disable || s->exit_latency <= latency_req)
> +			continue;
> +
> +		latency_req = s->exit_latency;
> +		ret = i;
> +	}
> +	return ret;
> +}
> +
> +/**
>   * cpuidle_enter_state - enter the state and update stats
>   * @dev: cpuidle device for this cpu
>   * @drv: cpuidle driver for this cpu
> @@ -124,6 +164,9 @@ int cpuidle_select(struct cpuidle_driver
>  	if (!drv || !dev || !dev->enabled)
>  		return -EBUSY;
>  
> +	if (unlikely(use_deepest_state))
> +		return cpuidle_find_deepest_state(drv, dev);
> +
>  	return cpuidle_curr_governor->select(drv, dev);
>  }
>  
> @@ -155,7 +198,7 @@ int cpuidle_enter(struct cpuidle_driver
>   */
>  void cpuidle_reflect(struct cpuidle_device *dev, int index)
>  {
> -	if (cpuidle_curr_governor->reflect)
> +	if (cpuidle_curr_governor->reflect && !unlikely(use_deepest_state))
>  		cpuidle_curr_governor->reflect(dev, index);
>  }
>  
> Index: linux-pm/include/linux/cpuidle.h
> ===================================================================
> --- linux-pm.orig/include/linux/cpuidle.h
> +++ linux-pm/include/linux/cpuidle.h
> @@ -143,6 +143,7 @@ extern void cpuidle_resume(void);
>  extern int cpuidle_enable_device(struct cpuidle_device *dev);
>  extern void cpuidle_disable_device(struct cpuidle_device *dev);
>  extern int cpuidle_play_dead(void);
> +extern void cpuidle_use_deepest_state(bool enable);
>  
>  extern struct cpuidle_driver *cpuidle_get_cpu_driver(struct cpuidle_device *dev);
>  #else
> @@ -175,6 +176,7 @@ static inline int cpuidle_enable_device(
>  {return -ENODEV; }
>  static inline void cpuidle_disable_device(struct cpuidle_device *dev) { }
>  static inline int cpuidle_play_dead(void) {return -ENODEV; }
> +static inline void cpuidle_use_deepest_state(bool enable) {}
>  static inline struct cpuidle_driver *cpuidle_get_cpu_driver(
>  	struct cpuidle_device *dev) {return NULL; }
>  #endif
> Index: linux-pm/kernel/power/suspend.c
> ===================================================================
> --- linux-pm.orig/kernel/power/suspend.c
> +++ linux-pm/kernel/power/suspend.c
> @@ -54,9 +54,11 @@ static void freeze_begin(void)
>  
>  static void freeze_enter(void)
>  {
> +	cpuidle_use_deepest_state(true);
>  	cpuidle_resume();
>  	wait_event(suspend_freeze_wait_head, suspend_freeze_wake);
>  	cpuidle_pause();
> +	cpuidle_use_deepest_state(false);
>  }
>  
>  void freeze_wake(void)
> 

Tested-by: Aubrey Li <aubrey.li@linux.intel.com>

I tested freeze mode on ASUS-T100, it works as expected. Thanks Rafael!

-Aubrey

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] PM / suspend: Always use deepest C-state in the "freeze" sleep state
  2014-05-04 22:51 [PATCH] PM / suspend: Always use deepest C-state in the "freeze" sleep state Rafael J. Wysocki
  2014-05-05 12:46 ` Li, Aubrey
@ 2014-05-09  7:38 ` Pavel Machek
  2014-05-09 11:26   ` Rafael J. Wysocki
  2014-05-12 14:08 ` Daniel Lezcano
  2 siblings, 1 reply; 10+ messages in thread
From: Pavel Machek @ 2014-05-09  7:38 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Linux PM list, Linux Kernel Mailing List, Daniel Lezcano,
	Zhang Rui, Aubrey Li

On Mon 2014-05-05 00:51:54, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> 
> If freeze_enter() is called, we want to bypass the current cpuidle
> governor and always use the deepest available (that is, not disabled)
> C-state, because we want to save as much energy as reasonably possible
> then and runtime latency constraints don't matter at that point, since
> the system is in a sleep state anyway.

Would there be way to pass the parameter "go to deepest" instead of adding
global state for this?
								Pavel

> Index: linux-pm/kernel/power/suspend.c
> ===================================================================
> --- linux-pm.orig/kernel/power/suspend.c
> +++ linux-pm/kernel/power/suspend.c
> @@ -54,9 +54,11 @@ static void freeze_begin(void)
>  
>  static void freeze_enter(void)
>  {
> +	cpuidle_use_deepest_state(true);
>  	cpuidle_resume();
>  	wait_event(suspend_freeze_wait_head, suspend_freeze_wake);
>  	cpuidle_pause();
> +	cpuidle_use_deepest_state(false);
>  }
>  
>  void freeze_wake(void)
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] PM / suspend: Always use deepest C-state in the "freeze" sleep state
  2014-05-09  7:38 ` Pavel Machek
@ 2014-05-09 11:26   ` Rafael J. Wysocki
  2014-05-09 14:13     ` Pavel Machek
  0 siblings, 1 reply; 10+ messages in thread
From: Rafael J. Wysocki @ 2014-05-09 11:26 UTC (permalink / raw)
  To: Pavel Machek
  Cc: Linux PM list, Linux Kernel Mailing List, Daniel Lezcano,
	Zhang Rui, Aubrey Li

On Friday, May 09, 2014 09:38:35 AM Pavel Machek wrote:
> On Mon 2014-05-05 00:51:54, Rafael J. Wysocki wrote:
> > From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> > 
> > If freeze_enter() is called, we want to bypass the current cpuidle
> > governor and always use the deepest available (that is, not disabled)
> > C-state, because we want to save as much energy as reasonably possible
> > then and runtime latency constraints don't matter at that point, since
> > the system is in a sleep state anyway.
> 
> Would there be way to pass the parameter "go to deepest" instead of adding
> global state for this?

I'm not sure what you mean?  A parameter of what in particular?  And where
to pass it?

Rafael


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] PM / suspend: Always use deepest C-state in the "freeze" sleep state
  2014-05-09 11:26   ` Rafael J. Wysocki
@ 2014-05-09 14:13     ` Pavel Machek
  2014-05-09 21:25       ` Rafael J. Wysocki
  0 siblings, 1 reply; 10+ messages in thread
From: Pavel Machek @ 2014-05-09 14:13 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Linux PM list, Linux Kernel Mailing List, Daniel Lezcano,
	Zhang Rui, Aubrey Li

On Fri 2014-05-09 13:26:47, Rafael J. Wysocki wrote:
> On Friday, May 09, 2014 09:38:35 AM Pavel Machek wrote:
> > On Mon 2014-05-05 00:51:54, Rafael J. Wysocki wrote:
> > > From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> > > 
> > > If freeze_enter() is called, we want to bypass the current cpuidle
> > > governor and always use the deepest available (that is, not disabled)
> > > C-state, because we want to save as much energy as reasonably possible
> > > then and runtime latency constraints don't matter at that point, since
> > > the system is in a sleep state anyway.
> > 
> > Would there be way to pass the parameter "go to deepest" instead of adding
> > global state for this?
> 
> I'm not sure what you mean?  A parameter of what in particular?  And where
> to pass it?

Currently the code is:

static void freeze_enter(void)
{
+ cpuidle_use_deepest_state(true);
  cpuidle_resume();
  wait_event(suspend_freeze_wait_head, suspend_freeze_wake);
  cpuidle_pause();
+ cpuidle_use_deepest_state(false);
}

. I believe it would be better if you did

cpuidle_resume(GOTO_DEEPEST_C_STATE)

instead of having global state.

Thanks,
										Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] PM / suspend: Always use deepest C-state in the "freeze" sleep state
  2014-05-09 14:13     ` Pavel Machek
@ 2014-05-09 21:25       ` Rafael J. Wysocki
  0 siblings, 0 replies; 10+ messages in thread
From: Rafael J. Wysocki @ 2014-05-09 21:25 UTC (permalink / raw)
  To: Pavel Machek
  Cc: Linux PM list, Linux Kernel Mailing List, Daniel Lezcano,
	Zhang Rui, Aubrey Li

On Friday, May 09, 2014 04:13:56 PM Pavel Machek wrote:
> On Fri 2014-05-09 13:26:47, Rafael J. Wysocki wrote:
> > On Friday, May 09, 2014 09:38:35 AM Pavel Machek wrote:
> > > On Mon 2014-05-05 00:51:54, Rafael J. Wysocki wrote:
> > > > From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> > > > 
> > > > If freeze_enter() is called, we want to bypass the current cpuidle
> > > > governor and always use the deepest available (that is, not disabled)
> > > > C-state, because we want to save as much energy as reasonably possible
> > > > then and runtime latency constraints don't matter at that point, since
> > > > the system is in a sleep state anyway.
> > > 
> > > Would there be way to pass the parameter "go to deepest" instead of adding
> > > global state for this?
> > 
> > I'm not sure what you mean?  A parameter of what in particular?  And where
> > to pass it?
> 
> Currently the code is:
> 
> static void freeze_enter(void)
> {
> + cpuidle_use_deepest_state(true);
>   cpuidle_resume();
>   wait_event(suspend_freeze_wait_head, suspend_freeze_wake);
>   cpuidle_pause();
> + cpuidle_use_deepest_state(false);
> }
> 
> . I believe it would be better if you did
> 
> cpuidle_resume(GOTO_DEEPEST_C_STATE)
> 
> instead of having global state.

That's a good idea actually.  I'll do that on top of the $subject patch.

Thanks!

-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] PM / suspend: Always use deepest C-state in the "freeze" sleep state
  2014-05-04 22:51 [PATCH] PM / suspend: Always use deepest C-state in the "freeze" sleep state Rafael J. Wysocki
  2014-05-05 12:46 ` Li, Aubrey
  2014-05-09  7:38 ` Pavel Machek
@ 2014-05-12 14:08 ` Daniel Lezcano
  2014-05-12 14:19   ` Li, Aubrey
  2 siblings, 1 reply; 10+ messages in thread
From: Daniel Lezcano @ 2014-05-12 14:08 UTC (permalink / raw)
  To: Rafael J. Wysocki, Linux PM list
  Cc: Linux Kernel Mailing List, Zhang Rui, Aubrey Li

On 05/05/2014 12:51 AM, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>
> If freeze_enter() is called, we want to bypass the current cpuidle
> governor and always use the deepest available (that is, not disabled)
> C-state, because we want to save as much energy as reasonably possible
> then and runtime latency constraints don't matter at that point, since
> the system is in a sleep state anyway.
>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> ---
>
> This is on top of https://patchwork.kernel.org/patch/4071541/ .
>

Wouldn't make sense to revisit play_dead instead ?



-- 
  <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] PM / suspend: Always use deepest C-state in the "freeze" sleep state
  2014-05-12 14:08 ` Daniel Lezcano
@ 2014-05-12 14:19   ` Li, Aubrey
  2014-05-12 14:52     ` Daniel Lezcano
  0 siblings, 1 reply; 10+ messages in thread
From: Li, Aubrey @ 2014-05-12 14:19 UTC (permalink / raw)
  To: Daniel Lezcano, Rafael J. Wysocki, Linux PM list
  Cc: Linux Kernel Mailing List, Zhang Rui, Aubrey Li

On 2014/5/12 22:08, Daniel Lezcano wrote:
> On 05/05/2014 12:51 AM, Rafael J. Wysocki wrote:
>> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>>
>> If freeze_enter() is called, we want to bypass the current cpuidle
>> governor and always use the deepest available (that is, not disabled)
>> C-state, because we want to save as much energy as reasonably possible
>> then and runtime latency constraints don't matter at that point, since
>> the system is in a sleep state anyway.
>>
>> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>> ---
>>
>> This is on top of https://patchwork.kernel.org/patch/4071541/ .
>>
> 
> Wouldn't make sense to revisit play_dead instead ?
> 
play_dead() is broken.

Even if it works, we still should rely on cpuidle driver to place the
CPUs into the deepest c-state, because there is no architectural way to
enter deepest c-state and what play_dead() does is a bad assumption.

Thanks,
-Aubrey


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] PM / suspend: Always use deepest C-state in the "freeze" sleep state
  2014-05-12 14:19   ` Li, Aubrey
@ 2014-05-12 14:52     ` Daniel Lezcano
  2014-05-12 23:53       ` Rafael J. Wysocki
  0 siblings, 1 reply; 10+ messages in thread
From: Daniel Lezcano @ 2014-05-12 14:52 UTC (permalink / raw)
  To: Li, Aubrey, Rafael J. Wysocki, Linux PM list
  Cc: Linux Kernel Mailing List, Zhang Rui, Aubrey Li

On 05/12/2014 04:19 PM, Li, Aubrey wrote:
> On 2014/5/12 22:08, Daniel Lezcano wrote:
>> On 05/05/2014 12:51 AM, Rafael J. Wysocki wrote:
>>> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>>>
>>> If freeze_enter() is called, we want to bypass the current cpuidle
>>> governor and always use the deepest available (that is, not disabled)
>>> C-state, because we want to save as much energy as reasonably possible
>>> then and runtime latency constraints don't matter at that point, since
>>> the system is in a sleep state anyway.
>>>
>>> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>>> ---
>>>
>>> This is on top of https://patchwork.kernel.org/patch/4071541/ .
>>>
>>
>> Wouldn't make sense to revisit play_dead instead ?
>>
> play_dead() is broken.
>
> Even if it works, we still should rely on cpuidle driver to place the
> CPUs into the deepest c-state, because there is no architectural way to
> enter deepest c-state and what play_dead() does is a bad assumption.

Ok, let me rephrase it. Why not revisiting cpuidle_play_dead instead ?


-- 
  <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] PM / suspend: Always use deepest C-state in the "freeze" sleep state
  2014-05-12 14:52     ` Daniel Lezcano
@ 2014-05-12 23:53       ` Rafael J. Wysocki
  0 siblings, 0 replies; 10+ messages in thread
From: Rafael J. Wysocki @ 2014-05-12 23:53 UTC (permalink / raw)
  To: Daniel Lezcano
  Cc: Li, Aubrey, Linux PM list, Linux Kernel Mailing List, Zhang Rui,
	Aubrey Li

On Monday, May 12, 2014 04:52:22 PM Daniel Lezcano wrote:
> On 05/12/2014 04:19 PM, Li, Aubrey wrote:
> > On 2014/5/12 22:08, Daniel Lezcano wrote:
> >> On 05/05/2014 12:51 AM, Rafael J. Wysocki wrote:
> >>> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> >>>
> >>> If freeze_enter() is called, we want to bypass the current cpuidle
> >>> governor and always use the deepest available (that is, not disabled)
> >>> C-state, because we want to save as much energy as reasonably possible
> >>> then and runtime latency constraints don't matter at that point, since
> >>> the system is in a sleep state anyway.
> >>>
> >>> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> >>> ---
> >>>
> >>> This is on top of https://patchwork.kernel.org/patch/4071541/ .
> >>>
> >>
> >> Wouldn't make sense to revisit play_dead instead ?
> >>
> > play_dead() is broken.
> >
> > Even if it works, we still should rely on cpuidle driver to place the
> > CPUs into the deepest c-state, because there is no architectural way to
> > enter deepest c-state and what play_dead() does is a bad assumption.
> 
> Ok, let me rephrase it. Why not revisiting cpuidle_play_dead instead ?

Many drivers don't implement the ->enter_dead() callback.

-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2014-05-12 23:37 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-04 22:51 [PATCH] PM / suspend: Always use deepest C-state in the "freeze" sleep state Rafael J. Wysocki
2014-05-05 12:46 ` Li, Aubrey
2014-05-09  7:38 ` Pavel Machek
2014-05-09 11:26   ` Rafael J. Wysocki
2014-05-09 14:13     ` Pavel Machek
2014-05-09 21:25       ` Rafael J. Wysocki
2014-05-12 14:08 ` Daniel Lezcano
2014-05-12 14:19   ` Li, Aubrey
2014-05-12 14:52     ` Daniel Lezcano
2014-05-12 23:53       ` Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).