Mladen Nikitovic wrote:
Hi,

My question relates to the issue with shutting down a processor. It seems there are several functions that could be used when disabling a processor (or several states to choose from when migrating to another state). My understanding is that using cpu_offline function involves many operations such as de-allocation of structures etc, which would be necessary if the intention was to never power up the processor again, or, if that operation is used very seldom.
However, I would like the dynamically activate and de-activate the 
processor(s), which would mean that certain administrative actions such as 
de-allocation of structures might be unnecessary. So, I wonder if there are 
other functions that could be suitable for my intentions, or if there are 
certain functions that I can disable in the cpu_offline sequence to make the 
shutdown of the processor a more in-expensive  operation. Currently, I noticed 
it takes up much more time than I expected...

I'm not certain what you are trying to achieve - not full power-off (which
requires platform support, anyway) and in fact something less than
the offline state achieved via psradm -f and similar?

cpu_offline drives the cpu to the offline state in which it is no
longer the target of interrupts and we no longer schedule any
work on it.  Few (if any?) structures are freed, for example the
cpu_t remains allocated for this cpu.  What does happen is that
it is unlinked from the cpu_active list and various other lists
in the cpu_t structure (next online, next online in partition etc).
Doing that is tricky since other cpus may be traversing the
cpu list at the time - the cpu_lock is held before calling
cpu_offline, but kernel threads are also guaranteed safe
traversal of the cpu list by disabling preemption (ie
not holding cpu_lock) so we need to synchronize with
all those possibilities.  To do this we schedule the
"pause thread" of each cpu onto all cpus - once all cpus
are in this known state we know they're not on cpu
with preemption disabled and we can now tat with
the cpu list.

Gavin

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

_______________________________________________
opensolaris-code mailing list
opensolaris-code@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to