Hi,
As I said before, we have a problem with using the CPU hotplug for suspending
because of the notifiers that are called from within cpu_up()/cpu_down() and
(sometimes) assume that the system is fully functional.
One obvious solution of this problem would be to make the notifiers behave
differently if tasks are frozen, but for this purpose we'd need to tell them
that this is the case. In principle, we could do it in many different ways
(eg. by using a global variable, with the help of suspend notifiers etc.), but
IMO one of the cleanest methods woud be to use some special values for the
notifications occuring while tasks are frozen (eg. CPU_DEAD_FROZEN instead of
CPU_DEAD etc.). In that case the notifiers could react in some special ways
to the "FROZEN" notfifications and that would allow us to simplify some code
paths (eg. in the microcode driver).
The appended patch introduces such "FROZEN" notfifications, modifies the CPU
hotplug core to use them and updates all of the users of CPU hotplug notifiers
to recognize them. For now, they are treated in the same way as the
corresponding "normal" notifications, but I'm going to modify the microcode
driver to really use them and I believe that some other subsystems can benefit
from using them as well.
The patch is totally experimental and untested, although it's been successfully
compiled on x86_64 and it's main purpose is to show what exactly I mean. :-)
Comments welcome.
Greetings,
Rafael