From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: xen-devel <xen-devel@lists.xenproject.org>,
Keir Fraser <keir@xen.org>,
David Vrabel <david.vrabel@citrix.com>, Tim Deegan <tim@xen.org>
Subject: Re: [PATCH 2/2] x86/crash: Disable the watchdog NMIs on the crashing cpu.
Date: Mon, 18 Nov 2013 10:33:16 +0000 [thread overview]
Message-ID: <5289ECEC.4030207@citrix.com> (raw)
In-Reply-To: <5289EB6F0200007800103EBB@nat28.tlf.novell.com>
On 18/11/13 09:26, Jan Beulich wrote:
>>>> On 15.11.13 at 21:32, Andrew Cooper <andrew.cooper3@citrix.com> wrote:
>> --- a/xen/arch/x86/crash.c
>> +++ b/xen/arch/x86/crash.c
>> @@ -118,6 +118,7 @@ static void nmi_shootdown_cpus(void)
>> unsigned long msecs;
>> int i, cpu = smp_processor_id();
>>
>> + disable_lapic_nmi_watchdog();
>> local_irq_disable();
>>
>> crashing_cpu = cpu;
> _If_ you do this here, I wonder why it's being done before
> disabling interrupts.
>
> But then again I wonder whether it wouldn't be better to do
> this even earlier (i.e. by passing a flag to watchdog_disable()),
> as the NMI watchdog becomes useless with that call being done
> from kexec_common_shutdown().
Disabling interrupts here is more defensive coding than anything else.
It is not expected to be able to get here with interrupts enabled, but
in a crash
Putting this in watchdog_disable() would result in a race condition.
disable_lapic_nmi_watchdog() mutates global state, meaning that it can
only possibly run correctly on a single cpu. In an ideal world with
plenty of time, the lapic watchdog code could be improved. However,
restricting its use until after one_cpu_only() is the easiest fix.
~Andrew
>
>> --- a/xen/arch/x86/nmi.c
>> +++ b/xen/arch/x86/nmi.c
>> @@ -165,7 +165,7 @@ static void nmi_timer_fn(void *unused)
>> set_timer(&this_cpu(nmi_timer), NOW() + MILLISECS(1000));
>> }
>>
>> -static void disable_lapic_nmi_watchdog(void)
>> +void disable_lapic_nmi_watchdog(void)
> The suggested alternative would also make it unnecessary to
> make this function non-static...
>
> Jan
>
next prev parent reply other threads:[~2013-11-18 10:33 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-15 20:32 [PATCH 0/2] Kexec crash path fixes Andrew Cooper
2013-11-15 20:32 ` [PATCH 1/2] common/kexec: Prevent deadlock on reentry to the crash path Andrew Cooper
2013-11-22 14:55 ` Andrew Cooper
2013-11-25 13:28 ` Jan Beulich
2013-11-25 13:30 ` Andrew Cooper
2013-11-25 13:39 ` Jan Beulich
2013-11-25 15:38 ` Andrew Cooper
2013-11-27 10:27 ` David Vrabel
2013-11-15 20:32 ` [PATCH 2/2] x86/crash: Disable the watchdog NMIs on the crashing cpu Andrew Cooper
2013-11-15 21:01 ` David Vrabel
2013-11-15 21:09 ` Andrew Cooper
2013-11-18 9:26 ` Jan Beulich
2013-11-18 10:33 ` Andrew Cooper [this message]
2013-11-18 10:35 ` Andrew Cooper
2013-11-18 11:04 ` Jan Beulich
2013-11-18 11:09 ` Andrew Cooper
2013-11-19 10:53 ` Ian Campbell
2013-11-20 15:08 ` [Patch v2 " Andrew Cooper
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=5289ECEC.4030207@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=JBeulich@suse.com \
--cc=david.vrabel@citrix.com \
--cc=keir@xen.org \
--cc=tim@xen.org \
--cc=xen-devel@lists.xenproject.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).