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.