cpu stopping [Was: preparation for x86/acpica/acpi_wakeup.c]
- From: Andriy Gapon <avg@xxxxxxxxxxx>
- Date: Sun, 03 Jun 2012 10:19:01 +0300
on 03/06/2012 00:39 Attilio Rao said the following:
The first thing to consider is that right now we only have 2 states
for CPUs: started and stopped. These states are controlled by
started_cpus and stopped_cpus masks respectively. It seems you really
want to add an intermediate level among the 2 where you have: started
-> suspended -> started -> suspended ... -> stopped and you need to
expand the mechanism for dealing with started and stopped cpus to do
that. I'm pretty sure this will be very helpful also for other
architectures that want to do the same.
As the first thing I must admit that I haven't looked at the patch :-)
But really I don't see why we need to differentiate between stopped and
suspended state as both of them ultimately mean exactly the same thing - CPUs
are spinning on some condition (and they are in a well-defined place and state).
My view of how this should work is:
- there can be only one master CPU that controls all other (slave) CPUs
- the master sets entry and exit hooks
- the master signals slaves to enter the stop state
- the slaves execute the enter hook and start spinning on the release condition
- the master does whatever it wants to do in this special system state
- the master signals the slaves to resume
- the slave exit the spin loop and execute the exit hook
We have almost all of this in place. Only now we have different IPIs and
different IPI handlers to do the job (cpustop_handler and cpususpend_handler).
I think that the hooks model should be more universal.
In my opinion, what really would deserve a completely independent path is the
hard-stop case. As this can be invoked nested to the other cases. E.g. exotic
situations like a breakpoint or a trap or a panic in the suspend or the normal
stop code paths.
freebsd-arch@xxxxxxxxxxx mailing list
To unsubscribe, send any mail to "freebsd-arch-unsubscribe@xxxxxxxxxxx"
- Re: cpu stopping
- From: Mitsuru IWASAKI
- Re: cpu stopping [Was: preparation for x86/acpica/acpi_wakeup.c]
- From: Attilio Rao
- Re: cpu stopping
- Prev by Date: Re: Fwd: [RFC] Kernel shared variables
- Next by Date: Re: cpu stopping [Was: preparation for x86/acpica/acpi_wakeup.c]
- Previous by thread: [RFC] Kernel shared variables
- Next by thread: Re: cpu stopping [Was: preparation for x86/acpica/acpi_wakeup.c]