Can "num_online_cpus()" return different values in the same run?
The name is suggesting it. If there are online cpus, are there offline cpus? can a offline cpu become online and vice versa?
Thanks in advance. 开发者_JAVA百科R.g.
Yes -- some architectures support "hot-pluggable CPUs":
http://www.kernel.org/doc/Documentation/cpu-hotplug.txt
Hardware that actually supports this is rare as hen's teeth, though.
it seems that online in this context means "available for scheduling" and based on what i read in include/linux/cpumask.h
where num_online_cpus()
is defined. i'd think it would be possible for it to return different values at different times but in any stable system i don't think it would commonly do so.
精彩评论