From: Hamza Mahfooz <hamzamahfooz@linux.microsoft.com>
To: Michael Kelley <mhklinux@outlook.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Dexuan Cui <decui@microsoft.com>, Wei Liu <wei.liu@kernel.org>,
"linux-hyperv@vger.kernel.org" <linux-hyperv@vger.kernel.org>,
Haiyang Zhang <haiyangz@microsoft.com>,
Petr Mladek <pmladek@suse.com>,
Andrew Morton <akpm@linux-foundation.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
John Ogness <john.ogness@linutronix.de>,
Jani Nikula <jani.nikula@intel.com>, Baoquan He <bhe@redhat.com>,
Thomas Gleixner <tglx@linutronix.de>,
Ryo Takakura <takakura@valinux.co.jp>
Subject: Re: [PATCH v2] panic: call panic handlers before panic_other_cpus_shutdown()
Date: Mon, 24 Feb 2025 09:48:31 -0500 [thread overview]
Message-ID: <Z7yGv_ZyeyUueXLz@hm-sls2> (raw)
In-Reply-To: <SN6PR02MB4157D993CCE04F2D46E2B8A1D4C72@SN6PR02MB4157.namprd02.prod.outlook.com>
On Fri, Feb 21, 2025 at 11:01:09PM +0000, Michael Kelley wrote:
> From: Hamza Mahfooz <hamzamahfooz@linux.microsoft.com> Sent: Friday, February 21, 2025 1:31 PM
> >
> > Since, the panic handlers may require certain cpus to be online to panic
> > gracefully, we should call them before turning off SMP. Without this
> > re-ordering, on Hyper-V hv_panic_vmbus_unload() times out, because the
> > vmbus channel is bound to VMBUS_CONNECT_CPU and unless the crashing cpu
> > is the same as VMBUS_CONNECT_CPU, VMBUS_CONNECT_CPU will be offlined by
> > crash_smp_send_stop() before the vmbus channel can be deconstructed.
>
> Hamza -- what specifically is the problem with the way vmbus_wait_for_unload()
> works today? That code is aware of the problem that the unload response comes
> only on the VMBUS_CONNECT_CPU, and that cpu may not be able to handle
> the interrupt. So the code polls the message page of each CPU to try to get the
> unload response message. Is there a scenario where that approach isn't working?
>
It doesn't work on arm64 (if the crashing cpu isn't VMBUS_CONNECT_CPU), it
always ends up at "VMBus UNLOAD did not complete" without fail. It seems
like arm64's crash_smp_send_stop() is more aggressive than x86's.
> Note also that Hyper-V itself can take a long time (10's of seconds) to respond
> to the unload request. See the comments in vmbus_wait_for_unload() about
> flushing the Azure host disk cache. I worked on this code and did the
> measurements, so I have some familiarity with the problems. :-)
>
> Michael
>
> >
> > Signed-off-by: Hamza Mahfooz <hamzamahfooz@linux.microsoft.com>
> > ---
> > v2: keep printk_legacy_allow_panic_sync() after
> > panic_other_cpus_shutdown().
> > ---
> > kernel/panic.c | 8 ++++----
> > 1 file changed, 4 insertions(+), 4 deletions(-)
> >
> > diff --git a/kernel/panic.c b/kernel/panic.c
> > index fbc59b3b64d0..433cf651e213 100644
> > --- a/kernel/panic.c
> > +++ b/kernel/panic.c
> > @@ -372,16 +372,16 @@ void panic(const char *fmt, ...)
> > if (!_crash_kexec_post_notifiers)
> > __crash_kexec(NULL);
> >
> > - panic_other_cpus_shutdown(_crash_kexec_post_notifiers);
> > -
> > - printk_legacy_allow_panic_sync();
> > -
> > /*
> > * Run any panic handlers, including those that might need to
> > * add information to the kmsg dump output.
> > */
> > atomic_notifier_call_chain(&panic_notifier_list, 0, buf);
> >
> > + panic_other_cpus_shutdown(_crash_kexec_post_notifiers);
> > +
> > + printk_legacy_allow_panic_sync();
> > +
> > panic_print_sys_info(false);
> >
> > kmsg_dump_desc(KMSG_DUMP_PANIC, buf);
> > --
> > 2.47.1
> >
>
next prev parent reply other threads:[~2025-02-24 14:48 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-21 21:30 [PATCH v2] panic: call panic handlers before panic_other_cpus_shutdown() Hamza Mahfooz
2025-02-21 23:01 ` Michael Kelley
2025-02-24 14:48 ` Hamza Mahfooz [this message]
2025-02-24 19:59 ` Michael Kelley
2025-02-24 20:57 ` Hamza Mahfooz
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=Z7yGv_ZyeyUueXLz@hm-sls2 \
--to=hamzamahfooz@linux.microsoft.com \
--cc=akpm@linux-foundation.org \
--cc=bhe@redhat.com \
--cc=decui@microsoft.com \
--cc=gregkh@linuxfoundation.org \
--cc=haiyangz@microsoft.com \
--cc=jani.nikula@intel.com \
--cc=john.ogness@linutronix.de \
--cc=linux-hyperv@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mhklinux@outlook.com \
--cc=pmladek@suse.com \
--cc=takakura@valinux.co.jp \
--cc=tglx@linutronix.de \
--cc=wei.liu@kernel.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