lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 13 Jan 2011 18:21:30 +0530
From:	Trinabh Gupta <trinabh@...ux.vnet.ibm.com>
To:	arjan@...ux.intel.com, peterz@...radead.org, lenb@...nel.org,
	suresh.b.siddha@...el.com, benh@...nel.crashing.org,
	venki@...gle.com, ak@...ux.intel.com
Cc:	linux-kernel@...r.kernel.org
Subject: [RFC V2 0/3] cpuidle: Cleanup pm_idle and include driver/cpuidle.c
	in-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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ