All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC V2 0/3] cpuidle: Cleanup pm_idle and include driver/cpuidle.c in-kernel
@ 2011-01-13 12:51 Trinabh Gupta
  2011-01-13 12:52 ` [RFC V2 1/3] cpuidle: Remove pm_idle pointer for x86 Trinabh Gupta
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Trinabh Gupta @ 2011-01-13 12:51 UTC (permalink / raw)
  To: arjan, peterz, lenb, suresh.b.siddha, benh, venki, ak; +Cc: linux-kernel

The core of the kernel's idle routine on x86 presently depends
on an exported pm_idle function pointer that is unmanaged.
The first problem is that this exported pointer can be modified
by any subsystem. There is no tracking or notification mechanism.
Secondly and more importantly, various subsystems save the value of
this pointer, flip it and later restore to the saved value. There is
no guarantee that the saved value is still valid. The problem has
been discussed at http://lkml.org/lkml/2009/8/28/43 and
http://lkml.org/lkml/2009/8/28/50.

This patch series tries to achieve the goal of having cpuidle manage
all idle routine management by doing the following changes:

* Remove pm_idle pointer from process_xx.c and implicitly call
  cpuidle.c:cpuidle_idle_call().

* Change select_idle_routine() in x86 bootup code to create
  a cpuidle_driver structure and register the routines with the
  cpuidle subsystem using a default_idle driver in 
  drivers/idle/default_driver.c

* The 'best' (current) cpuidle_driver is selected based
  on the priority that is supplied at the time of registration/
  unregistration.

* Arch supplied default idle (hlt or poll) is used during transitions.  

* List of cpuidle_drivers and their (per-cpu) cpuidle_devices are
  maintained in a doubly linked list to enable selection and unregistering 
  when not used. Previously cpuidle subsystem had only one set of
  cpuidle_driver and corresponding cpuidle_devices.

* Ideally we could have a single list of idle routines supplied by
  different modules and use a priority+governor to select the best.
  We could incrementally do this since we have a dependency: Only
  idle routines from a set (ACPI) should be used on all cpus and not
  a combination of say C1e on some cpus and ACPI routines on some
  other cpus.

This patch series applies on 2.6.37, and was tested on x86 system with
multiple sleep states. 

Request your comment on the general approach based on the discussion
in v1 (https://lkml.org/lkml/2010/10/19/449).

Changes from v1: cpuidle: add idle routine registration and cleanup 
pm_idle pointer

* v1 has registration mechanisms for single idle routines and expects
  cpuidle.c:cpuidle_idle_call() to take over for systems with multiple
  idle routines.

  While this series uses cpuidle.c:cpuidle_idle_call() as a means to
  invoke single idle routines as well as multiple idle routines. The 
  registration mechanism proposed in V1 is completely replaced by 
  cpuidle.c with added fields like 'priority'.

---

Trinabh Gupta (3):
      cpuidle: Default Idle Driver for x86
      cpuidle data structure changes, list based cpuidle driver registration
      cpuidle: Remove pm_idle pointer for x86


 arch/x86/kernel/process.c     |  340 -------------------------------
 arch/x86/kernel/process_32.c  |    4 
 arch/x86/kernel/process_64.c  |    4 
 arch/x86/xen/setup.c          |    1 
 drivers/acpi/processor_idle.c |    2 
 drivers/cpuidle/Kconfig       |    2 
 drivers/cpuidle/cpuidle.c     |   42 +---
 drivers/cpuidle/driver.c      |   68 +++++-
 drivers/cpuidle/governor.c    |   13 +
 drivers/idle/Makefile         |    2 
 drivers/idle/default_driver.c |  451 +++++++++++++++++++++++++++++++++++++++++
 include/linux/cpuidle.h       |    4 
 12 files changed, 543 insertions(+), 390 deletions(-)
 create mode 100644 drivers/idle/default_driver.c

-- 
-Trinabh

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

end of thread, other threads:[~2011-01-13 16:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-13 12:51 [RFC V2 0/3] cpuidle: Cleanup pm_idle and include driver/cpuidle.c in-kernel Trinabh Gupta
2011-01-13 12:52 ` [RFC V2 1/3] cpuidle: Remove pm_idle pointer for x86 Trinabh Gupta
2011-01-13 12:52 ` [RFC V2 2/3] cpuidle: list based cpuidle driver registration and selection Trinabh Gupta
2011-01-13 12:52 ` [RFC V2 3/3] cpuidle: default idle driver for x86 Trinabh Gupta
2011-01-13 15:47   ` Arjan van de Ven
2011-01-13 16:22     ` Vaidyanathan Srinivasan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.