Re: [PATCH 02/12] powermac: support G5 CPU hotplug

Johannes Berg
2007-02-09T15:39:21Z

[-- Attachment #1.1: Type: text/plain, Size: 1552 bytes --]

On Fri, 2007-02-09 at 08:59 +1100, Paul Mackerras wrote:
> Johannes Berg writes:
>
> > +#ifdef CONFIG_CPU_HOTPLUG
> > + /* if we have fake CPU hotplug just to support suspend to disk
> > + * and can't really turn off a CPU, it may be taking timer interrupts
> > + * even when it is dead. Avoid doing anything in that case so global
> > + * state is not modified for and by a CPU that doesn't really exist. */
> > + if (__get_cpu_var(cpu_state) == CPU_DEAD)
> > + return;
> > +#endif
>
> Are you sure this is necessary? IIRC, the if (!cpu_is_offline(cpu)) a
> little bit further down is there to cope with this exact situation.

Yes, but we still do irq_enter() and as it happens with HZ=1000 we
almost always kick the CPU out while it's inbetween irq_enter() and
irq_exit().

You said:

> And cpu hotplug already works on G4 SMP powermacs, where we can't
> physically remove the cpu either - we just put it into sleep mode with
> interrupts disabled, which is what we would be doing on a G5 powermac
> also.

and then Benh said:

> I've always had doubts about wether SLEEP with EE off was legal and
> wouldn't actually still go out of sleep when getting an interrupt... In
> that case, at least on CPUs where the DEC acts "level" triggered, we
> need to at least reset the DEC to some sane value.

I probably should've mentioned that. I tried going into NAP with EE off
and that seemed to get me a busy loop where the CPU wasn't even napping
at all. I could have done something wrong, of course.

johannes

[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 190 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]