linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Nicholas Piggin <npiggin@gmail.com>
To: Anton Blanchard <anton@samba.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>, linuxppc-dev@ozlabs.org
Subject: Re: [PATCH v2] powerpc/xmon: Wait for secondaries before IPI'ing on system reset
Date: Mon, 1 May 2017 12:03:00 +1000	[thread overview]
Message-ID: <20170501120300.18e1a4d4@roar.ozlabs.ibm.com> (raw)
In-Reply-To: <20170430222758.79fa94ea@kryten>

On Sun, 30 Apr 2017 22:27:58 +1000
Anton Blanchard <anton@samba.org> wrote:

> Hi Nick,
> 
> > An externally triggered system reset (e.g., via QEMU nmi command, or
> > pseries reset button) can cause system reset interrupts on all CPUs.
> > In case this causes xmon to be entered, it is undesirable for the
> > primary (first) CPU into xmon to trigger an NMI IPI to others,
> > because this may cause a nested system reset interrupt.
> > 
> > So spin for a time waiting for secondaries to join xmon before
> > performing the NMI IPI, similarly to what the crash dump code does.  
> 
> That reminds me of similar delays in our crash path:
> 
> /*
>  * The primary CPU waits a while for all secondary CPUs to enter. This is to
>  * avoid sending an IPI if the secondary CPUs are entering
>  * crash_kexec_secondary on their own (eg via a system reset).
>  *
>  * The secondary timeout has to be longer than the primary. Both timeouts are
>  * in milliseconds.
>  */
> #define PRIMARY_TIMEOUT         500
> #define SECONDARY_TIMEOUT       1000
> 
> ...
> 
>         /*
>          * If we came in via system reset, wait a while for the secondary
>          * CPUs to enter.
>          */
>         if (TRAP(regs) == 0x100)
>                 mdelay(PRIMARY_TIMEOUT);
> 
> We might want to consolidate the juggling we do. Not sure if many people use
> it, but kdb and kgdb may benefit if we make it common.

Good point, yes we definitely should consolidate these. I had a few misc patches
that were supposed to improve the crash paths to go after the NMI stacks and
IPIs series. I'll look at consolidating some of this timeout logic there, if
nobody beats me to it. Thanks.

      reply	other threads:[~2017-05-01  2:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-28 11:07 [PATCH v2] powerpc/xmon: Wait for secondaries before IPI'ing on system reset Michael Ellerman
2017-04-29 11:06 ` kbuild test robot
2017-04-30 12:27 ` Anton Blanchard
2017-05-01  2:03   ` Nicholas Piggin [this message]

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=20170501120300.18e1a4d4@roar.ozlabs.ibm.com \
    --to=npiggin@gmail.com \
    --cc=anton@samba.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=mpe@ellerman.id.au \
    /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).