Re: [PATCH 0/4] CPUFreq: Implement per policy instances of governors

From: Borislav Petkov
Date: Mon Feb 04 2013 - 11:51:15 EST


On Mon, Feb 04, 2013 at 09:07:11PM +0530, Viresh Kumar wrote:
> I don't have board right now to take the snapshot, but it would be
> like:
>
> $ tree /sys/devices/system/cpu/cpu0/cpufreq/
> /sys/devices/system/cpu/cpu0/cpufreq/
> âââ affected_cpus
> âââ bios_limit
> âââ cpb
> âââ cpuinfo_cur_freq
> âââ cpuinfo_max_freq
> âââ cpuinfo_min_freq
> âââ cpuinfo_transition_latency
> âââ related_cpus
> âââ scaling_available_frequencies
> âââ scaling_available_governors
> âââ scaling_cur_freq
> âââ scaling_driver
> âââ scaling_governor
> âââ scaling_max_freq
> âââ scaling_min_freq
> âââ scaling_setspeed
> âââ stats
> âââ time_in_state
> âââ total_trans
> âââ trans_table
> âââ ondemand
> âââ sampling_rate
> âââ up_threshold
> âââ ignore_nice

So this is adding the current governor as a per-cpu thing.

> > One thing I've come to realize with the current interface is that if
> > you want to change stuff, you need to iterate over all cpus instead of
> > writing to a system-wide node.
>
> Not really. Following is the way by which cpu/cpu*/cpufreq directories
> are created:

That's not what I meant - I meant from userspace:

for $i in $(grep processor /proc/cpuinfo | awk '{ print $3 }');
do
echo "performance" > /sys/devices/system/cpu/cpu$i/cpufreq/scaling_governor;
done

Instead of

echo "performance" > /sys/devices/system/cpu/cpufreq/scaling_governor

which is hypothetical but sets it for the whole system without fuss.

[ â ]

> I want to control it over clock-domain, but can't get that in cpu/cpufreq/.
> Policies don't have numbers assigned to them.

So, give them names.

> So, i am working on ARM's big.LITTLE system where we have two
> clusters. One of A15s and other of A7s. Because of their different
> power ratings or performance figures, we need to have separate set of
> ondemand tunables for them. And hence this patch. Though this patch is
> required for any multi-cluster system.

So you want this (values after "="):

cpu/cpufreq/
|-> policy0
|-> name = A15
|-> min_freq = ...
|-> max_freq = ...
|-> affected_cpus = 0,1,2,...
|-> ondemand
|-> sampling_rate
|-> up_threshold
|-> ignore_nice
...
|-> policy1
|-> name = A7
|-> min_freq = ...
|-> max_freq = ...
|-> affected_cpus = n,n+1,n+2,...
|-> performance
|-> sampling_rate
|-> up_threshold
|-> ignore_nice
...

Other arches create other policies and that's it. If you need another
policy added to the set, you simply add 'policyN++' and that's it.

I think this is cleaner but whatever - I don't care that much. My
only strong concern is that this thing should be a Kconfig option and
optional for arches where it doesn't apply.

Thanks.

--
Regards/Gruss,
Boris.

Sent from a fat crate under my desk. Formatting is fine.
--
--
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/