LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@osdl.org>, Dave Jones <davej@redhat.com>,
	linux-acpi@vger.kernel.org, Adam Belay <abelay@novell.com>,
	Shaohua Li <shaohua.li@intel.com>,
	Len Brown <len.brown@intel.com>
Subject: Re: [PATCH 3/3]cpuidle take2: Basic documentation for cpuidle
Date: Tue, 27 Feb 2007 10:39:37 +0100	[thread overview]
Message-ID: <20070227093936.GA6766@elf.ucw.cz> (raw)
In-Reply-To: <20070222135457.C26335@unix-os.sc.intel.com>

Hi!

> Documentation for cpuidle infrastructure
> 
> Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
> Signed-off-by: Adam Belay <abelay@novell.com>
> Signed-off-by: Shaohua Li <shaohua.li@intel.com>
> 
> Index: linux-2.6.21-rc-mm/Documentation/cpuidle/core.txt
> ===================================================================
> --- /dev/null
> +++ linux-2.6.21-rc-mm/Documentation/cpuidle/core.txt
> @@ -0,0 +1,17 @@
> +
> +		Supporting multiple CPU idle levels in kernel
> +
> +				cpuidle
> +
> +General Information:
> +
> +Various CPUs today support multiple idle levels that are differentiated
> +by varying exit latencies and power consumption during idle.
> +cpuidle is a generic in-kernel infrastructure that separates
> +idle policy (governor) from idle mechanism (driver) and provides a
> +standardized infrastructure to support independent development of
> +governors and drivers.
> +
> +cpuidle resides under /drivers/cpuidle.

Drop leading slash? Merge this to some other docs, since it is so
short?


> Index: linux-2.6.21-rc-mm/Documentation/cpuidle/driver.txt
> ===================================================================
> --- /dev/null
> +++ linux-2.6.21-rc-mm/Documentation/cpuidle/driver.txt
> @@ -0,0 +1,24 @@
> +
> +
> +		Supporting multiple CPU idle levels in kernel
> +
> +				cpuidle drivers
> +
> +
> +
> +
> +cpuidle driver supports capability detection for a particular system. The
> +init and exit routines will be called for each online CPU, with a percpu
> +cpuidle_driver object and driver should fill in cpuidle_states inside
> +cpuidle_driver depending on the CPU capability.

Huh, perhaps it would be nice to explain what the driver does?

Now we know that it does...

> +Driver can handle dynamic state changes (like battery<->AC), by calling
> +force_redetect interface.
> +
> +It is possible to have more than one driver registered at the same time and
> +user can switch between drivers using /sysfs interface.
> +
> +Interfaces:
> +int cpuidle_register_driver(struct cpuidle_driver *drv);
> +void cpuidle_unregister_driver(struct cpuidle_driver *drv);
> +int cpuidle_force_redetect(struct cpuidle_device *dev);

register, unregister and redetect... but that somehow does not seem complete?

> Index: linux-2.6.21-rc-mm/Documentation/cpuidle/sysfs.txt
> ===================================================================
> --- /dev/null
> +++ linux-2.6.21-rc-mm/Documentation/cpuidle/sysfs.txt
> @@ -0,0 +1,27 @@
> +
> +
> +		Supporting multiple CPU idle levels in kernel
> +
> +				cpuidle sysfs
> +
> +System global cpuidle information are under
> +/sys/devices/system/cpu/cpuidle

"information is"? (Not 100% sure).

> +Under this percpu directory, there is a directory for each idle state supported
> +by the driver, which in turn has
> +* latency
> +* power
> +* time
> +* usage

This should say... latency (in microseconds), power (in miliwats), and
explain what time (which units?) and usage means. (Total time spent in
that state, usage == number of enters into that state?)

> +		Supporting multiple CPU idle levels in kernel
> +
> +				cpuidle governors
> +
> +
> +cpuidle governor is policy routine that decides what idle state to enter at
> +any given time. cpuidle core uses different callbacks to governor while
> +handling idle entry.
> +* select_state callback where governor can determine next idle state to enter
> +* prepare_idle callback is called before entering an idle state
> +* scan callback is called after a driver forces redetection of the states

Can we get some visual separation between functions and their
descriptions?

scan() callback?

scan -- callback?

> +More than one governor can be registered at the same time and
> +user can switch between drivers using /sysfs interface.

<describe interface here>?

Explain why we want more than one governor?
								Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

      reply	other threads:[~2007-02-27  9:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-22 21:54 Venkatesh Pallipadi
2007-02-27  9:39 ` Pavel Machek [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070227093936.GA6766@elf.ucw.cz \
    --to=pavel@ucw.cz \
    --cc=abelay@novell.com \
    --cc=akpm@osdl.org \
    --cc=davej@redhat.com \
    --cc=len.brown@intel.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=shaohua.li@intel.com \
    --cc=venkatesh.pallipadi@intel.com \
    --subject='Re: [PATCH 3/3]cpuidle take2: Basic documentation for cpuidle' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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).