From: Keir Fraser <keir.xen@gmail.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>,
Xen-devel <xen-devel@lists.xen.org>
Cc: Tim Deegan <tim@xen.org>, Jan Beulich <JBeulich@suse.com>
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 [thread overview]
Message-ID: <CE683996.5EFB8%keir.xen@gmail.com> (raw)
In-Reply-To: <1380052613-3837-1-git-send-email-andrew.cooper3@citrix.com>
On 24/09/2013 20:56, "Andrew Cooper" <andrew.cooper3@citrix.com> 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 <andrew.cooper3@citrix.com>
> CC: Keir Fraser <keir@xen.org>
> CC: Jan Beulich <JBeulich@suse.com>
> CC: Tim Deegan <tim@xen.org>
>
> ---
>
> @@ -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 <keir@xen.org>
> + 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();
next prev parent reply other threads:[~2013-09-25 5:56 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-24 19:56 [PATCH 1/2] x86/crash: Indicate how well nmi_shootdown_cpus() managed to do Andrew Cooper
2013-09-24 19:56 ` [PATCH 2/2] DO NOT APPLY - debugging code to lock a pcpu in an NMI loop Andrew Cooper
2013-09-25 5:56 ` Keir Fraser [this message]
2013-09-25 7:35 ` [PATCH 1/2] x86/crash: Indicate how well nmi_shootdown_cpus() managed to do Jan Beulich
2013-09-25 10:22 ` [Patch v2] " Andrew Cooper
2013-09-25 11:41 ` Keir Fraser
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CE683996.5EFB8%keir.xen@gmail.com \
--to=keir.xen@gmail.com \
--cc=JBeulich@suse.com \
--cc=andrew.cooper3@citrix.com \
--cc=tim@xen.org \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).