From mboxrd@z Thu Jan 1 00:00:00 1970 From: Keir Fraser Subject: Re: [PATCH 1/2] x86/crash: Indicate how well nmi_shootdown_cpus() managed to do. Date: Wed, 25 Sep 2013 06:56:22 +0100 Message-ID: References: <1380052613-3837-1-git-send-email-andrew.cooper3@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1380052613-3837-1-git-send-email-andrew.cooper3@citrix.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: Andrew Cooper , Xen-devel Cc: Tim Deegan , Jan Beulich List-Id: xen-devel@lists.xenproject.org On 24/09/2013 20:56, "Andrew Cooper" wrote: > Having nmi_shootdown_cpus() report which pcpus failed to be shot down is a > useful debugging hint as to what possibly went wrong (especially when the > crash logs seem to indicate that an NMI timeout occurred while waiting for one > of the problematic pcpus to perform an action). > > This is achieved by swapping an atomic_t count of unreported pcpus with a > cpumask. In the case that the 1 second timeout occurs, use the cpumask to > identify the problematic pcpus. > > Signed-off-by: Andrew Cooper > CC: Keir Fraser > CC: Jan Beulich > CC: Tim Deegan > > --- > > @@ -162,12 +164,22 @@ static void nmi_shootdown_cpus(void) > smp_send_nmi_allbutself(); > > msecs = 1000; /* Wait at most a second for the other cpus to stop */ > - while ( (atomic_read(&waiting_for_crash_ipi) > 0) && msecs ) > + while ( (cpumask_weight(&waiting_to_crash) > 0) && msecs ) > { > mdelay(1); > msecs--; > } > > + /* Leave a hint of how well we did trying to shoot down the other cpus */ > + if ( msecs ) if (cpumask_empty(&waiting_to_crash)) Would be more obvious I think. Apart from that Acked-by: Keir Fraser > + printk("Shot down all cpus\n"); > + else > + { > + cpulist_scnprintf(keyhandler_scratch, sizeof keyhandler_scratch, > + &waiting_to_crash); > + printk("Failed to shoot down cpus {%s}\n", keyhandler_scratch); > + } > + > /* Crash shutdown any IOMMU functionality as the crashdump kernel is not > * happy when booting if interrupt/dma remapping is still enabled */ > iommu_crash_shutdown();