Re: [PATCH] 3/3 Dynamic cpufreq governor and updates to ACPIP-state driver

From: Carl Thompson
Date: Tue Oct 21 2003 - 14:25:24 EST


I know Linus wrote this but...

> ...

> A quote from Peter Anvin:
>
> "What is worse is that the interface is, in my opinion, fundamentally
> broken for *ALL* CPUs. It doesn't present a policy interface to the
> kernel, instead it presents a frequency-setting interface and expect
> the policy to be done in userspace. The kernel is the only part of
> the
> system which has sufficient information (idle times of all CPUs, for
> example) to do a decent job managing the CPU frequency efficiently.
> On Transmeta CPUs this policy should simply be passed down to CMS, of
> course; on other CPUs the kernel needs to manage 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_.

But userspace _can_ know the idle statistics for each CPU. It's easily read
from /proc/stat.

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

Well, my "cpuspeed" daemon has been doing exactly this without problems for
the better part of a year on many laptops tested by me and others. Polling
the CPU temperature every second or two seems quite sufficient to head off
any heat related problems (including on problematic systems like the Sony
Vaio FXA series). It doesn't appear to necessary to poll faster on current
hardware even with severe load spikes. (Obviously, hardware failures in
the cooling system are another matter but the CPUs internal protection
should handle that.)

My cpuspeed daemon uses a negligable amount of CPU so it doesn't seem like a
terrible solution...

(As mentioned previously, CPUs that change their own speed are a separate
issue.)

Carl Thompson

> ...


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/