From: Ryo Takakura <ryotkkr98@gmail.com>
To: mpe@ellerman.id.au, npiggin@gmail.com,
christophe.leroy@csgroup.eu, naveen@kernel.org,
maddy@linux.ibm.com, sourabhjain@linux.ibm.com,
hbathini@linux.ibm.com, leobras.c@gmail.com, pmladek@suse.com,
john.ogness@linutronix.de
Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org,
Ryo Takakura <ryotkkr98@gmail.com>
Subject: [PATCH] powerpc/crash: Allow direct printing on kexec
Date: Sun, 20 Oct 2024 16:17:55 +0900 [thread overview]
Message-ID: <20241020071755.328706-1-ryotkkr98@gmail.com> (raw)
Since the commit af2876b501e4 ("powerpc/crash: Use NMI context for printk
when starting to crash"), printing has been deferred before shutting down
non-panicked CPU on kexec to avoid deadlock on logbuf_lock. It is deferred
until the shutdown of the first kernel and starts booting into the second
kernel. As a result, there is no messages printed for legacy consoles,
including crash_kexec_post_notifiers messages which is after the
syncing of legacy console at printk_legacy_allow_panic_sync().
Let legacy consoles print directly so that we can see messages on kexec, as
the commit b6cf8b3f3312 ("printk: add lockless ringbuffer") turned printk
ring buffer lockless and there should be no worries panicked CPU
deadlocking writing into ringbuffer after shutting down non-panicked CPU.
Signed-off-by: Ryo Takakura <ryotkkr98@gmail.com>
---
Hi!
My understanding is that deferred printing can also be safely removed
in terms of console lock as the commit d51507098ff9 ("printk: disable
optimistic spin during panic") prevented from spinning in case of panic.
Sincerely,
Ryo Takakura
---
arch/powerpc/kexec/crash.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/arch/powerpc/kexec/crash.c b/arch/powerpc/kexec/crash.c
index 9ac3266e4965..5e5260e0d964 100644
--- a/arch/powerpc/kexec/crash.c
+++ b/arch/powerpc/kexec/crash.c
@@ -269,9 +269,6 @@ static inline void crash_kexec_wait_realmode(int cpu) {}
void crash_kexec_prepare(void)
{
- /* Avoid hardlocking with irresponsive CPU holding logbuf_lock */
- printk_deferred_enter();
-
/*
* This function is only called after the system
* has panicked or is otherwise in a critical state.
--
2.34.1
next reply other threads:[~2024-10-20 9:50 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-20 7:17 Ryo Takakura [this message]
2024-10-20 20:41 ` [PATCH] powerpc/crash: Allow direct printing on kexec John Ogness
2024-10-21 12:11 ` Ryo Takakura
2024-10-21 12:27 ` John Ogness
2024-10-21 14:44 ` Ryo Takakura
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=20241020071755.328706-1-ryotkkr98@gmail.com \
--to=ryotkkr98@gmail.com \
--cc=christophe.leroy@csgroup.eu \
--cc=hbathini@linux.ibm.com \
--cc=john.ogness@linutronix.de \
--cc=leobras.c@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=maddy@linux.ibm.com \
--cc=mpe@ellerman.id.au \
--cc=naveen@kernel.org \
--cc=npiggin@gmail.com \
--cc=pmladek@suse.com \
--cc=sourabhjain@linux.ibm.com \
/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).