CPU hotplug vs. cpufreq on ppc64

Johannes Berg johannes at sipsolutions.net
Tue Feb 6 04:33:30 EST 2007


Hi,

> CPU0 comes online first, and no other CPUs are online yet.  CPU0 cannot 
> advertise to cpufreq what his affected CPUs are because CPU1, CPU2, and 
> CPU3 do not exist!

Actually, the current powermac cpufreq code does (and can because it
knows that there are only 4 CPUs that you can't actually hotplug
physically.)

> At this point in time, the kernel is only aware of 
> CPU0, which is the only CPU that cpufreq manages for the moment.

Right, the current cpufreq code still sets policy->cpus = 1|2|4|8
though.

> Now, say CPU1 comes online.  CPU1 now knows that itself and CPU0 are 
> tied together in freq scaling.

Aha, so the knowledge should be the other way around.

> However, CPU0 is still left in the dark, 
> and thinks that he only manages himself.  So CPU1 will register itself, 
> and tell cpufreq that its affected cpus are itself and CPU0.  The 
> cpufreq driver will see that CPU0 is already managed, update CPU0's 
> affected cpus data structure, symlink CPU1 to CPU0, and finally call 
> exit on CPU1 to clean up.

Ok.

> Same story for CPU2 and CPU3.

Yeah, I understand now. Thanks for the explanation. I think the fix is
actually trivial too.

johannes
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20070205/b8a3fb7f/attachment.pgp>


More information about the Linuxppc-dev mailing list