[linux-pm] [RFC 07/10] powermac: support G5 CPU hotplug

Pavel Machek pavel at ucw.cz
Tue Feb 6 23:42:12 EST 2007


Hi!

> This patch allows "hotplugging" of CPUs on G5 machines. CPUs that are
> disabled are put into an idle loop with interrupts hard-disabled, to wake
> them up again we kick them just like when bringing them up.
> 
> Maybe there's some way to actually turn off those CPUs even more?
> 
> Cc: Benjamin Herrenschmidt <benh at kernel.crashing.org>

> --- mb-wireless.orig/arch/powerpc/kernel/smp.c	2007-02-05 16:07:09.274524763 +0100
> +++ mb-wireless/arch/powerpc/kernel/smp.c	2007-02-05 18:15:51.114524763 +0100
> @@ -558,6 +558,11 @@ int __devinit start_secondary(void *unus
>  
>  	local_irq_enable();
>  
> +	/* it seems to be possible that we died from within
> +	 * an interrupt ... reset the in-irq counts */
> +	task_thread_info(paca[cpu].__current)->preempt_count &=
> +		~(SOFTIRQ_MASK|HARDIRQ_MASK);
> +
>  	cpu_idle();
>  	return 0;

This is quite a nasty hack. Are you sure?

I've seen similar weirdness on pc, and it was caused by
swsusp-copying-code using FPU and incrementing preempt_count...

								Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html



More information about the Linuxppc-dev mailing list