Skip to content

Commit b0da640

Browse files
committed
Merge tag 'printk-for-6.11-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux
Pull printk fix from Petr Mladek: - Do not block printk on non-panic CPUs when they are dumping backtraces * tag 'printk-for-6.11-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux: printk/panic: Allow cpu backtraces to be written into ringbuffer during panic
2 parents 47ac09b + bcc954c commit b0da640

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

include/linux/panic.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ extern void oops_enter(void);
1616
extern void oops_exit(void);
1717
extern bool oops_may_print(void);
1818

19+
extern bool panic_triggering_all_cpu_backtrace;
1920
extern int panic_timeout;
2021
extern unsigned long panic_print;
2122
extern int panic_on_oops;

kernel/panic.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ unsigned long panic_on_taint;
6464
bool panic_on_taint_nousertaint = false;
6565
static unsigned int warn_limit __read_mostly;
6666

67+
bool panic_triggering_all_cpu_backtrace;
68+
6769
int panic_timeout = CONFIG_PANIC_TIMEOUT;
6870
EXPORT_SYMBOL_GPL(panic_timeout);
6971

@@ -253,8 +255,12 @@ void check_panic_on_warn(const char *origin)
253255
*/
254256
static void panic_other_cpus_shutdown(bool crash_kexec)
255257
{
256-
if (panic_print & PANIC_PRINT_ALL_CPU_BT)
258+
if (panic_print & PANIC_PRINT_ALL_CPU_BT) {
259+
/* Temporary allow non-panic CPUs to write their backtraces. */
260+
panic_triggering_all_cpu_backtrace = true;
257261
trigger_all_cpu_backtrace();
262+
panic_triggering_all_cpu_backtrace = false;
263+
}
258264

259265
/*
260266
* Note that smp_send_stop() is the usual SMP shutdown function,

kernel/printk/printk.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2316,7 +2316,7 @@ asmlinkage int vprintk_emit(int facility, int level,
23162316
* non-panic CPUs are generating any messages, they will be
23172317
* silently dropped.
23182318
*/
2319-
if (other_cpu_in_panic())
2319+
if (other_cpu_in_panic() && !panic_triggering_all_cpu_backtrace)
23202320
return 0;
23212321

23222322
if (level == LOGLEVEL_SCHED) {

0 commit comments

Comments
 (0)