Hi,
On 5/18/07, Eric Saxe <[EMAIL PROTECTED]> wrote:
Thomas De Schampheleire wrote:
>
> I am wondering what the difference is between the CPU_OFFLINE and
> CPU_POWEROFF state, for the operating system.
>
> Of course there is a hardware difference, i.e. the voltage is cut in
> CPU_POWEROFF etc., but does this make a difference for the OS?
> Is it correct that neither in CPU_OFFLINE, neither in CPU_POWEROFF
> interrupts are serviced?
According to the flag description in cpuvar.h, with CPU_OFFLINE the CPU
can still service interrupts...but that's all it can do.
In practice, when you offline a CPU with something like psradm(1M), both the
CPU_OFFLINE and CPU_QUIESCED flags are set for the CPU (if the platform
allows it (see the comment in cpu_offline() just above where we call
cpu_intr_disable())
which completely quiesces the CPU to where it won't have to run
interrupt threads.
1257 /*
1258 * Take the CPU out of interrupt participation so we won't find
1259 * bound kernel threads. If the architecture cannot completely
1260 * shut off interrupts on the CPU, don't quiesce it, but don't
1261 * run anything but interrupt thread... this is indicated by
1262 * the CPU_OFFLINE flag being on but the CPU_QUIESCE flag being
1263 * off.
1264 */
1265 intr_enable = cp->cpu_flags & CPU_ENABLE;
1266 if (intr_enable)
1267 no_quiesce = cpu_intr_disable(cp);
If I understand this correctly, if the cpu was flagged 'enable', then
interrupts are disabled. If it was not, interrupts are not disabled,
but I suppose it is assumed that when enable is not on interrupts are
already disabled, right?
However, the cpu_intr_disable() function does not seem to clear the
'enable' flag. Shouldn't this happen somewhere?
Now I have your attention, would you care to take a look at another
thread of mine, titled
"modgetsymvalue, modules, sbdp_cpu_poweroff()" ? It was posted to this
same mailing list.
Thanks a lot,
Thomas
With CPU_POWEROFF, the CPU is off, so it can't service interrupts (and
when that
flag is set, usually the CPU_QUIESCED flag is set too).
There's some platform specific stuff that the OS needs to do to make the
transition between being "quiesced" and "powered off" (which, if you've
been poking around
in sbd.c you've probably seen)....but from, say, the dispatcher's point
of view, in both cases
the CPU is pretty much out of service.
-Eric
_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code