tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: A simple cpufreq(9)



On Fri, Sep 23, 2011 at 08:42:16PM +0200, Joerg Sonnenberger wrote:
> On Fri, Sep 23, 2011 at 01:02:52PM +0300, Jukka Ruohonen wrote:
> > [2] Note that even in the x86 land it is no longer necessarily known which
> >     is the exact MHz at which the CPU currently runs (cf. TurboBoost, etc.).
> 
> TurboBoost is a good reason for why "percent" is a bad measurement as
> well. In fact, I find it more confusing. If a tool reports to the user
> that NetBSD runs the CPU at 85% during a build.sh -j16, that's going to
> result in surprising questions...

Well this is not really the case with TurboBoost; while there are few
somewhat vague means to know the "turbo" in the kernel (not as a MHz
though), this would show in the userland as 100 %, like it would show for
the users of the MI functions.

> Consider making the "unit" of scaling an additional attribute of the
> list and provide userland with:
> 
> id, data, unit
> 
> as list, get/set is using the id.

I particularly wanted to avoid importing any lists to the MI kernel parts or
to the userland. Using a percentage like done in OpenBSD would greatly
simplify further uses in the kernel. But of course an unit of measurement
(MHz, voltage, etc.) can be imported for heuristic purposes.

Nor do I see any real difference whether an user sets the CPU frequency to
"{ 16 %, 35 %, 100 % } MHz" or to "{ 821, 922, 1657 } MHz", expect that the
former is clearer and more user friendly.

Note also that for instance some ARM systems may use very fine grained lists.

- Jukka.


Home | Main Index | Thread Index | Old Index