On 26 May 2014 10:53, Ryan ryanphilips19@googlemail.com wrote:
Thanks for your help.
Your welcome..
I was trying to print the policy pointer of each cpu - and it points to the same address for all cpus.
Good, so all CPUs are sharing the same clock line in your case. You are probably using an ARM board :)
But could not find the code which does that (when cpu is added it should point to the same structure)
static int __cpufreq_add_dev(struct device *dev, struct subsys_interface *sif) ... for_each_cpu(j, policy->cpus) per_cpu(cpufreq_cpu_data, j) = policy;
Also as i undertsand: CPUFREQ_GOV_POLICY_INIT and CPUFREQ_GOV_POLICY_EXIT is called only when we change the governor.
No. It is called when we allocate/create policy structure for the first time. So, once for every group of CPUs sharing clock line.
When we add a cpu we do CPUFREQ_GOV_STOP, CPUFREQ_GOV_START and CPUFREQ_GOV_LIMITS. I did not understand why we need to do this when we add or remove cpu's.
Because we need to updated policy->cpus, i.e. CPUs managed by this policy. Most of the governors today, schedule a per-cpu time based on this field only.