[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250221022328.47078-1-ryotkkr98@gmail.com>
Date: Fri, 21 Feb 2025 11:23:28 +0900
From: Ryo Takakura <ryotkkr98@...il.com>
To: hamzamahfooz@...ux.microsoft.com
Cc: akpm@...ux-foundation.org,
bhe@...hat.com,
decui@...rosoft.com,
gregkh@...uxfoundation.org,
haiyangz@...rosoft.com,
jani.nikula@...el.com,
jfalempe@...hat.com,
joel.granados@...nel.org,
john.ogness@...utronix.de,
linux-hyperv@...r.kernel.org,
linux-kernel@...r.kernel.org,
pmladek@...e.com,
takakura@...inux.co.jp,
wei.liu@...nel.org
Subject: Re: [PATCH RFC] panic: call panic handlers before panic_other_cpus_shutdown()
Hi Hamza!
On Thu, 20 Feb 2025 17:53:00 -0500, Hamza Mahfooz wrote:
>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.
>
>Signed-off-by: Hamza Mahfooz <hamzamahfooz@...ux.microsoft.com>
>---
> kernel/panic.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
>diff --git a/kernel/panic.c b/kernel/panic.c
>index fbc59b3b64d0..9712a46dfe27 100644
>--- a/kernel/panic.c
>+++ b/kernel/panic.c
>@@ -372,8 +372,6 @@ 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();
I think printk_legacy_allow_panic_sync() is placed after
panic_other_cpus_shutdown() so that it flushes the stored
cpus backtraces as described [0].
> /*
>@@ -382,6 +380,8 @@ void panic(const char *fmt, ...)
> */
> atomic_notifier_call_chain(&panic_notifier_list, 0, buf);
>
>+ panic_other_cpus_shutdown(_crash_kexec_post_notifiers);
>+
So maybe panic_other_cpus_shutdown() should be palced after
atomic_notifier_call_chain() along with printk_legacy_allow_panic_sync()
like below?
----- BEGIN -----
diff --git a/kernel/panic.c b/kernel/panic.c
index d8635d5cecb2..7ac40e85ee27 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);
----- END -----
Sincerely,
Ryo Takakura
[0] https://lore.kernel.org/all/20240820063001.36405-30-john.ogness@linutronix.de/
Powered by blists - more mailing lists