diff options
author | John Ogness <john.ogness@linutronix.de> | 2022-02-11 12:29:37 +0106 |
---|---|---|
committer | Petr Mladek <pmladek@suse.com> | 2022-02-15 16:10:55 +0100 |
commit | 2ba3673d70178bf07fb75ff25c54bc478add4021 (patch) | |
tree | 5d56f38d31a066c307f00d41b46f96cb5212362f /kernel/ptrace.c | |
parent | a229327733b86aa585effdb0d27a87b12aa51597 (diff) | |
download | linux-2ba3673d70178bf07fb75ff25c54bc478add4021.tar.gz |
printk: use atomic updates for klogd work
The per-cpu @printk_pending variable can be updated from
sleepable contexts, such as:
get_random_bytes()
warn_unseeded_randomness()
printk_deferred()
defer_console_output()
and can be updated from interrupt contexts, such as:
handle_irq_event_percpu()
__irq_wake_thread()
wake_up_process()
try_to_wake_up()
select_task_rq()
select_fallback_rq()
printk_deferred()
defer_console_output()
and can be updated from NMI contexts, such as:
vprintk()
if (in_nmi()) defer_console_output()
Therefore the atomic variant of the updating functions must be used.
Replace __this_cpu_xchg() with this_cpu_xchg().
Replace __this_cpu_or() with this_cpu_or().
Reported-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: John Ogness <john.ogness@linutronix.de>
Signed-off-by: Petr Mladek <pmladek@suse.com>
Link: https://lore.kernel.org/r/87iltld4ue.fsf@jogness.linutronix.de
Diffstat (limited to 'kernel/ptrace.c')
0 files changed, 0 insertions, 0 deletions