From: Keir Fraser Subject: Re: [PATCH 00/04] Kexec / Kdump: Release 20061122 (xen-unstable-12502) Date: Tue, 28 Nov 2006 18:50:34 +0000 Message-ID: References: <1164738244.3336.214.camel@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1164738244.3336.214.camel@localhost.localdomain> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Ian Campbell , Magnus Damm Cc: Ian Pratt , Kazuo Moriwaka , xen-devel@lists.xensource.com, magnus.damm@gmail.com, Akio Takebe , Isaku Yamahata , Horms List-Id: xen-devel@lists.xenproject.org On 28/11/06 6:24 pm, "Ian Campbell" wrote: > You define a per CPU variable crash_notes and on crash you loop over > NR_CPUS and clear the notes for CPUS which don't exist. Unfortunately > the percpu regions for CPUs which aren't physically present is returned > to the heap on boot (see percpu_free_unused_areas) -- this means that > you zero out heap pages on crash :-( > > You need to use num_{possible,present,online}_cpus() in > machine_crash_kexec() and kexec_get_cpu() instead of NR_CPUS. You should use for_each_cpu, for_each_present_cpu, or for_each_online_cpu. Probably the last of those unless you care about dormant CPUs or hotplugged CPU sockets. :-) -- Keir