History

Merge tag 'printk-for-5.16-fixup' of git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux

Pull printk fixes from Petr Mladek: - Try to flush backtraces from other CPUs also on the local one. This was a regression caused by printk_safe buffers removal. - Remove header dependency warning. * tag 'printk-for-5.16-fixup' of git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux: printk: Remove printk.h inclusion in percpu.h printk: restore flushing of NMI buffers on remote CPUs after NMI backtraces

Linus Torvalds committed 4 years ago

Commit 7d5775d2 parents 42eb8fd bf6d0d15 files · +21 −1Browse files

Unified · Split

5 files
  1. arch/powerpc/kernel/watchdog.c +6 −0
  2. include/linux/percpu.h +0 −1
  3. include/linux/printk.h +4 −0
  4. kernel/printk/printk.c +5 −0
  5. lib/nmi_backtrace.c +6 −0
arch/powerpc/kernel/watchdog.c+6−0
@@ -187,6 +187,12 @@ static void watchdog_smp_panic(int cpu, u64 tb) · 186 unmodified lines
187 if (sysctl_hardlockup_all_cpu_backtrace)187 if (sysctl_hardlockup_all_cpu_backtrace)
188 trigger_allbutself_cpu_backtrace();188 trigger_allbutself_cpu_backtrace();
189 189
190 /*
191 * Force flush any remote buffers that might be stuck in IRQ context
192 * and therefore could not run their irq_work.
193 */
194 printk_trigger_flush();
195
190 if (hardlockup_panic)196 if (hardlockup_panic)
191 nmi_panic(NULL, "Hard LOCKUP");197 nmi_panic(NULL, "Hard LOCKUP");
192 198
include/linux/percpu.h+0−1
@@ -6,7 +6,6 @@ · 5 unmodified lines
6#include <linux/preempt.h>6#include <linux/preempt.h>
7#include <linux/smp.h>7#include <linux/smp.h>
8#include <linux/cpumask.h>8#include <linux/cpumask.h>
9#include <linux/printk.h>
10#include <linux/pfn.h>9#include <linux/pfn.h>
11#include <linux/init.h>10#include <linux/init.h>
12 11
include/linux/printk.h+4−0
@@ -198,6 +198,7 @@ void dump_stack_print_info(const char *log_lvl); · 197 unmodified lines
198void show_regs_print_info(const char *log_lvl);198void show_regs_print_info(const char *log_lvl);
199extern asmlinkage void dump_stack_lvl(const char *log_lvl) __cold;199extern asmlinkage void dump_stack_lvl(const char *log_lvl) __cold;
200extern asmlinkage void dump_stack(void) __cold;200extern asmlinkage void dump_stack(void) __cold;
201void printk_trigger_flush(void);
201#else202#else
202static inline __printf(1, 0)203static inline __printf(1, 0)
203int vprintk(const char *s, va_list args)204int vprintk(const char *s, va_list args)
@@ -274,6 +275,9 @@ static inline void dump_stack_lvl(const char *log_lvl) · 70 unmodified lines
274static inline void dump_stack(void)275static inline void dump_stack(void)
275{276{
276}277}
278static inline void printk_trigger_flush(void)
279{
280}
277#endif281#endif
278 282
279#ifdef CONFIG_SMP283#ifdef CONFIG_SMP
kernel/printk/printk.c+5−0
@@ -3253,6 +3253,11 @@ void defer_console_output(void) · 3252 unmodified lines
3253 preempt_enable();3253 preempt_enable();
3254}3254}
3255 3255
3256void printk_trigger_flush(void)
3257{
3258 defer_console_output();
3259}
3260
3256int vprintk_deferred(const char *fmt, va_list args)3261int vprintk_deferred(const char *fmt, va_list args)
3257{3262{
3258 int r;3263 int r;
lib/nmi_backtrace.c+6−0
@@ -75,6 +75,12 @@ void nmi_trigger_cpumask_backtrace(const cpumask_t *mask, · 74 unmodified lines
75 touch_softlockup_watchdog();75 touch_softlockup_watchdog();
76 }76 }
77 77
78 /*
79 * Force flush any remote buffers that might be stuck in IRQ context
80 * and therefore could not run their irq_work.
81 */
82 printk_trigger_flush();
83
78 clear_bit_unlock(0, &backtrace_flag);84 clear_bit_unlock(0, &backtrace_flag);
79 put_cpu();85 put_cpu();
80}86}