On Tue, Sep 16, 2025 at 11:57:11AM +0200, Petr Mladek wrote:
> On Mon 2025-08-25 10:29:29, Jinchao Wang wrote:
> > This patch introduces four new helper functions to abstract the
> > management of the panic_cpu variable. These functions will be used in
> > subsequent patches
crash_kexec() had its own code to exclude parallel execution by setting
panic_cpu. This is already handled by panic_try_start(). Switch to
panic_try_start() to remove the duplication and keep the logic consistent.
Signed-off-by: Jinchao Wang
---
kernel/crash_core.c | 15 +++
1 file
panic originator.
panic_on_other_cpu():
Returns true if a panic is on another CPU.
This change lays the groundwork for improved code readability
and robustness in the panic handling subsystem.
Signed-off-by: Jinchao Wang
---
include/linux/panic.h | 6 +
kernel/panic.c | 53
The helper this_cpu_in_panic() duplicated logic already provided by
panic_on_this_cpu().
Remove this_cpu_in_panic() and switch all users to panic_on_this_cpu().
This simplifies the code and avoids having two helpers for the same check.
Signed-off-by: Jinchao Wang
---
include/linux/printk.h
nbcon_context_try_acquire() compared panic_cpu directly with
smp_processor_id(). This open-coded check is now provided by
panic_on_this_cpu().
Switch to panic_on_this_cpu() to simplify the code and improve readability.
Signed-off-by: Jinchao Wang
---
kernel/printk/nbcon.c | 4 ++--
1 file
panic handling
logic for better clarity and robustness.
Signed-off-by: Jinchao Wang
Acked-by Qianqiang Liu
---
drivers/video/fbdev/core/fbcon.c | 9 +
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c
On 8/29/25 10:30, Qianqiang Liu wrote:
On Mon, Aug 25, 2025 at 10:29:31AM +0800, Jinchao Wang wrote:
crash_kexec() had its own code to exclude parallel execution by setting
panic_cpu. This is already handled by panic_try_start(). Switch to
panic_try_start() to remove the duplication and keep
skipped once a panic
has begun.
This prevents recursive panic and keeps the panic path more reliable.
Signed-off-by: Jinchao Wang
Reviewed-by: Yury Norov (NVIDIA)
---
kernel/watchdog.c | 6 ++
kernel/watchdog_perf.c | 4
2 files changed, 10 insertions(+)
diff --git a/kernel
The helper other_cpu_in_panic() duplicated logic already provided by
panic_on_other_cpu().
Remove other_cpu_in_panic() and update all users to call
panic_on_other_cpu() instead.
This removes redundant code and makes panic handling consistent.
Signed-off-by: Jinchao Wang
---
kernel/printk
: Jinchao Wang
---
kernel/panic.c | 8 ++--
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/kernel/panic.c b/kernel/panic.c
index cd86d37d124c..5266e195f5ac 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -415,7 +415,6 @@ void vpanic(const char *fmt, va_list args
Yury Norov.
Link to v1:
https://lore.kernel.org/all/20250820091702.512524-1-wangjinchao...@gmail.com/
Jinchao Wang (9):
panic: Introduce helper functions for panic state
fbdev: Use panic_in_progress() helper
crash_core: use panic_try_start() in crash_kexec()
panic: use panic_try_start
.
Signed-off-by: Jinchao Wang
---
kernel/panic.c | 10 ++
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/kernel/panic.c b/kernel/panic.c
index eacb0c972110..cd86d37d124c 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -355,15 +355,9 @@ EXPORT_SYMBOL(panic_on_other_cpu
On 8/21/25 10:43, Baoquan He wrote:
On 08/20/25 at 05:14pm, Jinchao Wang wrote:
crash_kexec() had its own code to exclude
parallel execution by setting panic_cpu.
This is already handled by panic_try_start().
Switch to panic_try_start() to remove the
duplication and keep the logic consistent
crash_kexec() had its own code to exclude
parallel execution by setting panic_cpu.
This is already handled by panic_try_start().
Switch to panic_try_start() to remove the
duplication and keep the logic consistent.
Signed-off-by: Jinchao Wang
---
kernel/crash_core.c | 15 +++
1 file
14 matches
Mail list logo