SMP System Without CPU Hotplug?
Back in the day, CPU hotplug was an optional and rarely used feature of Linux kernels built for SMP systems. However, increasing numbers of popular CPU families prohibit building Linux kernels with both
CONFIG_SMP=y. So much so that I no longer have access to a system that supports mainline kernels built with this combination of Kconfig options. This means that I have been putting up with
rcutorture output containing
:CONFIG_HOTPLUG_CPU: improperly set errors, which is of course annoying, and will soon motivate me to rework the
rcutorture test scenarios so as to eliminate this false positive. A side effect of this expected change is that
rcutorture will no longer even try to test SMP kernels built without CPU hotplug.
Why prohibit this combination of Kconfig options? It turns out that some of the defenses against hardware side-channel attacks rely on CPU hotplug, so the CPU families vulnerable to such attacks are ensuring that CPU hotplug is available on all systems having at least two CPUs. Security is great, thus so far so good!
Unfortunately, this is a problem for you if you use a CPU family that permits
CONFIG_SMP=y and you actually need to build kernels this way. Please keep in mind that there really have been RCU bugs that only manifest in such kernels. Given that I no longer have the means to test for these bugs, Murphy asserts that such bugs will quietly but fatally accumulate.
So what are your options? Here are a few:
- Rework your CPU family's Kconfig options to force
CONFIG_CPU_HOTPLUG=yin any kernel build that enables
- Start running
rcutortureon your hardware frequently enough to catch any bugs that might find their way into
CONFIG_SMP=yconfigurations. I am happy to help you get started with this, which will require updating the
rcutorturescripting to support your CPU family, defining additional
rcutorturescenarios, and having someone (not me!) do the actual
rcutortureruns on your hardware on a regular basis.
- Just ignore the problem in the fond hope that no such bugs will ever appear.
I believe that the first option is best, given that RCU is not the only Linux-kernel subsystem vulnerable to bugs specific to kernels built with
CONFIG_SMP=y. But at the end of the day, it is your CPU family, so it is your decision!