Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1310537 > unrolled thread
| Started by | "Rafael J. Wysocki" <rjw@rjwysocki.net> |
|---|---|
| First post | 2016-01-16 01:00 +0100 |
| Last post | 2016-01-18 15:40 +0100 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH 1/2] sched / idle: Drop default_idle_call() fallback from call_cpuidle() "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2016-01-16 01:00 +0100
Re: [PATCH 1/2] sched / idle: Drop default_idle_call() fallback from call_cpuidle() Peter Zijlstra <peterz@infradead.org> - 2016-01-18 15:40 +0100
| From | "Rafael J. Wysocki" <rjw@rjwysocki.net> |
|---|---|
| Date | 2016-01-16 01:00 +0100 |
| Subject | [PATCH 1/2] sched / idle: Drop default_idle_call() fallback from call_cpuidle() |
| Message-ID | <qRmrE-4Gw-15@gated-at.bofh.it> |
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
After commit 9c4b2867ed7c (cpuidle: menu: Fix menu_select() for
CPUIDLE_DRIVER_STATE_START == 0) it is clear that menu_select()
cannot return negative values. Moreover, ladder_select_state()
will never return a negative value too, so make find_deepest_state()
return non-negative values too and drop the default_idle_call()
fallback from call_cpuidle().
This eliminates one branch from the idle loop and makes the governors
and find_deepest_state() handle the case when all states have been
disabled from sysfs consistently.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
Note: Commit 9c4b2867ed7c (cpuidle: menu: Fix menu_select() for
CPUIDLE_DRIVER_STATE_START == 0) is in linux-next only ATM.
---
drivers/cpuidle/cpuidle.c | 6 +++---
kernel/sched/idle.c | 6 ------
2 files changed, 3 insertions(+), 9 deletions(-)
Index: linux-pm/drivers/cpuidle/cpuidle.c
===================================================================
--- linux-pm.orig/drivers/cpuidle/cpuidle.c
+++ linux-pm/drivers/cpuidle/cpuidle.c
@@ -79,9 +79,9 @@ static int find_deepest_state(struct cpu
bool freeze)
{
unsigned int latency_req = 0;
- int i, ret = -ENXIO;
+ int i, ret = 0;
- for (i = 0; i < drv->state_count; i++) {
+ for (i = 1; i < drv->state_count; i++) {
struct cpuidle_state *s = &drv->states[i];
struct cpuidle_state_usage *su = &dev->states_usage[i];
@@ -243,7 +243,7 @@ int cpuidle_enter_state(struct cpuidle_d
* @drv: the cpuidle driver
* @dev: the cpuidle device
*
- * Returns the index of the idle state.
+ * Returns the index of the idle state. The return value must not be negative.
*/
int cpuidle_select(struct cpuidle_driver *drv, struct cpuidle_device *dev)
{
Index: linux-pm/kernel/sched/idle.c
===================================================================
--- linux-pm.orig/kernel/sched/idle.c
+++ linux-pm/kernel/sched/idle.c
@@ -97,12 +97,6 @@ void default_idle_call(void)
static int call_cpuidle(struct cpuidle_driver *drv, struct cpuidle_device *dev,
int next_state)
{
- /* Fall back to the default arch idle method on errors. */
- if (next_state < 0) {
- default_idle_call();
- return next_state;
- }
-
/*
* The idle task must be scheduled, it is pointless to go to idle, just
* update no idle residency and return.
[toc] | [next] | [standalone]
| From | Peter Zijlstra <peterz@infradead.org> |
|---|---|
| Date | 2016-01-18 15:40 +0100 |
| Subject | Re: [PATCH 1/2] sched / idle: Drop default_idle_call() fallback from call_cpuidle() |
| Message-ID | <qSj8l-1Wu-15@gated-at.bofh.it> |
| In reply to | #1310537 |
On Sat, Jan 16, 2016 at 12:54:53AM +0100, Rafael J. Wysocki wrote:
> This eliminates one branch from the idle loop and makes the governors
> and find_deepest_state() handle the case when all states have been
> disabled from sysfs consistently.
> Index: linux-pm/kernel/sched/idle.c
> ===================================================================
> --- linux-pm.orig/kernel/sched/idle.c
> +++ linux-pm/kernel/sched/idle.c
> @@ -97,12 +97,6 @@ void default_idle_call(void)
> static int call_cpuidle(struct cpuidle_driver *drv, struct cpuidle_device *dev,
> int next_state)
> {
> - /* Fall back to the default arch idle method on errors. */
> - if (next_state < 0) {
> - default_idle_call();
> - return next_state;
> - }
> -
> /*
> * The idle task must be scheduled, it is pointless to go to idle, just
> * update no idle residency and return.
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web