Re: [PATCH][2.5.32] CPU frequency and voltage scaling (0/4)

Linus Torvalds (torvalds@transmeta.com)
Wed, 28 Aug 2002 17:08:14 -0700 (PDT)


On 29 Aug 2002, Alan Cox wrote:
>
> So what you are saying is that you want to be sure that something like
> "please run at a low speed to save battery" is translated by smarter
> cpus into "please save battery" and on spudstop the CPU would go "umm
> duh ok 300MHz"

Yup, exactly.

I suspect that this is also what most people actually want to use anyway:
you don't care that your CPU is a speedstep 1GHz/500Mhz or a 700/300 (or
whatever the combinations are), you really want to just say "go to power
save mode" vs "go to performance mode".

Sure, for speedstep, you can obviously trivially _emulate_ this in user
mode with the frequency approach, but for the generic case it isn't.

I don't know how many policies would be needed (too many just adds
complexity for no gain), but I _suspect_ that something like a

{ min-Hz, max-Hz, policy }

triple with "policy" being just a few different values ("performance",
"powersave") is sufficient. Clearly this triple trivially _becomes_ the
"single MHz" by just making min and max be the same if you really want one
particular MHz (at which time "policy" doesn't matter).

With something like the above, you could do something like

{ 0, ~0UL, "performance" } => generic highest performance setting
{ 0, ~0UL, "power-save" } => generic power-save setting
{ 300, 500, "performance" } => give me a performance setting in the specified range
{ 1700, 1700, "performance" } => run at a fixed 1.7GHz

(maybe the "policy" thing actually makes a difference even for the
fixed-frequency case: it can give hints about whether to allow C1-C3
states when idle etc).

Linus

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