From: Tim Deegan Subject: Re: [PATCH 09 of 10] arm: SMP CPU shutdown Date: Tue, 28 Feb 2012 18:13:26 +0000 Message-ID: <20120228181326.GA18897@ocelot.phlegethon.org> References: <1330425518.31269.61.camel@zakaz.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1330425518.31269.61.camel@zakaz.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Campbell Cc: "xen-devel@lists.xensource.com" , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org At 10:38 +0000 on 28 Feb (1330425518), Ian Campbell wrote: > On Thu, 2012-02-23 at 17:40 +0000, Tim Deegan wrote: > > # HG changeset patch > > # User Tim Deegan > > # Date 1330018799 0 > > # Node ID a78bc9b8421492e0545c6d52c7a32b9de9737d61 > > # Parent d35b52e5fde829dfbaf3da73e0716d004faded2f > > arm: SMP CPU shutdown > > > > For completeness, also implelent the CPU shutdown path. > > Does something free the init_stack for a CPU as it goes down? Er, no. :) > Alternatively the bring up path could reuse it if the CPU came back but > we don't seem to do that either. I'll make it so. > > Signed-off-by: TIm Deegan > > Typo here. WHat TYpo? I ALways SIgn MY NAme THat WAy. > [...] > > + /* It's now safe to remove this processor from the online map */ > > + cpumask_clear_cpu(cpu, &cpu_online_map); > > + > > + if ( cpu_disable_scheduler(cpu) ) > > + BUG(); > > + mb(); > > + > > + /* Return to caller; eventually the IPI mecahnism will unwind and the > > mechanism ta. > > + * scheduler will drop to the idle loop, which will call stop_cpu(). */ > > +} > > + > > +void stop_cpu(void) > > +{ > > + local_irq_disable(); > > + cpu_is_dead = 1; > > Do we lock this variable? What stops multiple CPUs coming down at once? IIRC that's serialized at a higher level, and the x86 equivalent similarly uses static variables for signalling. Will double-check before I re-send this series (probably next week). Cheers, Tim.