public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dominik Brodowski <devel@brodo.de>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: cpufreq@www.linux.org.uk, linux-kernel@vger.kernel.org
Subject: Re: [PATCH][2.5.32] CPU frequency and voltage scaling (0/4)
Date: Wed, 28 Aug 2002 22:19:47 +0200	[thread overview]
Message-ID: <20020828221947.A816@brodo.de> (raw)
In-Reply-To: <Pine.LNX.4.33.0208281140030.4507-100000@penguin.transmeta.com>; from torvalds@transmeta.com on Wed, Aug 28, 2002 at 11:47:54AM -0700

On Wed, Aug 28, 2002 at 11:47:54AM -0700, Linus Torvalds wrote:
> 
> On Wed, 28 Aug 2002, Dominik Brodowski wrote:
> > 
> > The following patches add CPU frequency and volatage scaling
> > support (Intel SpeedStep, AMD PowerNow, etc.) to kernel 2.5.32
> 
> The thing is, this interface appears fundamentally broken with respect to
> CPU's that change their frequency on the fly. I happen to know one such 
> CPU rather well myself.
Do these CPUs need kernel support? E.g. do udelay() calls work as
expected? If so, there's no need to make a driver aware of something
which isn't in its scope to control. CPUFreq is basically for those many
systems where frequency switches need to be called from the OS. 

> What is this interface supposed to do about a CPU that can change its 
> frequency dynamically several hundred times a second? Having the OS 
> control it simply isn't an option - the overhead of the control is _way_ 
> more than is acceptable at that level.
Well, that's probably the idea that's behind the microcode approach of
certain CPUs. However, for many voltage-scaling-able CPUs there is no such
microcode, and so the OS _needs_ to do it.

> In other words: there is no valid way that a _user_ can set the policy
> right now: the user can set the frequency, but since any sane policy
> depends on how busy the CPU is, the user isn't even, the right person to
> _do_ that, since the user doesn't _know_.
This is only true on CPUs where frequency switches can occur "on the fly"
with very low latency. Most voltage-scaling CPUs are currently found on 
mobile systems. For those notebook users it is a big step forward to have
this ability of switching between "full speed" and "low speed" depending on
the power source. And on LART systems even dynamic switching _from
userspace_ has proven to be successful (see OLS talk my Erik Mouw).
Please note that even a "kernel-based frequency selector" needs large parts
of the cpufreq core and drivers: udelay() calls need to be accurate,
external limitations (like on ARM systems) need to be integrated, and the
frequency and voltage switching mechanisms need to be implemented --
so is there any reason why this "kernel-based frequency selector" couldn't 
just use the existing interface: cpufreq_set()?

> Also note that policy is not just about how busy the CPU is, but also 
> about how _hot_ the CPU is. Again, a user-mode application (that maybe 
> polls the situation every minute or so), simply _cannot_ handle this 
> situation. You need to have the ability to poll the CPU tens of times a 
> second to react to heat events, and clearly user mode cannot do that 
> without impacting performance in a big way.
IMHO a cpufreq interface shouldn't become too bloated. If it would try to
drop the frequency quite aggressively this should be enough,
critical-temperature shutdown / throttling mechanisms will take
care of emergenices.

> The interface needs to be improved upon. It is simply _not_ valid to say
> "run at this speed" as the primary policy.
This is right. But a sane kernel-based frequency selector doesn't exist yet.
Even if it existed, it would need large parts of the cpufreq patches
submitted today. And these offer some support which isn't the best thing
since sliced bread but still is happily used by users.

	Dominik

  parent reply	other threads:[~2002-08-28 20:18 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-08-28 11:46 [PATCH][2.5.32] CPU frequency and voltage scaling (0/4) Dominik Brodowski
2002-08-28 18:47 ` Linus Torvalds
2002-08-28 18:48   ` Cort Dougan
2002-08-28 19:25     ` Alan Cox
2002-08-28 19:32       ` Cort Dougan
2002-08-29 10:26         ` Zwane Mwaikambo
2002-08-28 19:41       ` Peter Riocreux
2002-08-28 19:58       ` Linus Torvalds
2002-08-29  9:51         ` Padraig Brady
2002-08-29 10:23     ` Zwane Mwaikambo
2002-08-28 19:21   ` Alan Cox
2002-08-28 19:49     ` Linus Torvalds
2002-08-28 20:25       ` Alan Cox
2002-08-28 20:29         ` Linus Torvalds
2002-08-28 23:26           ` Alan Cox
2002-08-28 23:49             ` Linus Torvalds
2002-08-30  0:39               ` jw schultz
2002-08-29  7:01             ` Dominik Brodowski
2002-08-28 20:39         ` Dominik Brodowski
2002-08-28 21:05           ` Linus Torvalds
2002-09-06 11:31             ` Pavel Machek
2002-08-28 20:27       ` Dominik Brodowski
2002-08-28 20:19   ` Dominik Brodowski [this message]
2002-08-28 20:43     ` Linus Torvalds
2002-08-28 20:53       ` Dominik Brodowski
2002-08-28 21:08         ` Linus Torvalds
2002-08-28 23:00           ` george anzinger
2002-08-28 23:30           ` Alan Cox
2002-08-29  0:08             ` Linus Torvalds
2002-08-29  7:07               ` Dominik Brodowski
2002-08-29 10:02               ` Padraig Brady
2002-08-29 10:53               ` Alan Cox
2002-08-29 13:38                 ` Dave Jones
2002-08-29 18:47                 ` Linus Torvalds
2002-08-29 19:24                   ` Alan Cox
2002-08-29 21:22                   ` george anzinger
2002-08-30  6:46                     ` David Gibson
2002-08-30  7:54                     ` Helge Hafting
2002-08-30  3:21                 ` David Lang
  -- strict thread matches above, loose matches on Subject: below --
2002-08-28 20:25 Grover, Andrew
2002-08-28 20:46 ` Linus Torvalds
2002-08-29 15:07 Pering, Trevor
2002-08-30  8:04 ` Helge Hafting
2002-08-30 11:53   ` Dave Jones
2002-08-30 12:36     ` Helge Hafting
2002-08-30 22:43       ` george anzinger

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=20020828221947.A816@brodo.de \
    --to=devel@brodo.de \
    --cc=cpufreq@www.linux.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.com \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox