diff options
Diffstat (limited to 'debian/patches-rt/0263-tty-sysrq-Convert-show_lock-to-raw_spinlock_t.patch')
-rw-r--r-- | debian/patches-rt/0263-tty-sysrq-Convert-show_lock-to-raw_spinlock_t.patch | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/debian/patches-rt/0263-tty-sysrq-Convert-show_lock-to-raw_spinlock_t.patch b/debian/patches-rt/0263-tty-sysrq-Convert-show_lock-to-raw_spinlock_t.patch new file mode 100644 index 000000000..25b626e50 --- /dev/null +++ b/debian/patches-rt/0263-tty-sysrq-Convert-show_lock-to-raw_spinlock_t.patch @@ -0,0 +1,63 @@ +From 80d2475bc6d0eacb1cf634c16818c86554fcee0c Mon Sep 17 00:00:00 2001 +From: Julien Grall <julien.grall@arm.com> +Date: Wed, 13 Mar 2019 11:40:34 +0000 +Subject: [PATCH 263/347] tty/sysrq: Convert show_lock to raw_spinlock_t +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.246-rt110.tar.xz + +Systems which don't provide arch_trigger_cpumask_backtrace() will +invoke showacpu() from a smp_call_function() function which is invoked +with disabled interrupts even on -RT systems. + +The function acquires the show_lock lock which only purpose is to +ensure that the CPUs don't print simultaneously. Otherwise the +output would clash and it would be hard to tell the output from CPUx +apart from CPUy. + +On -RT the spin_lock() can not be acquired from this context. A +raw_spin_lock() is required. It will introduce the system's latency +by performing the sysrq request and other CPUs will block on the lock +until the request is done. This is okay because the user asked for a +backtrace of all active CPUs and under "normal circumstances in +production" this path should not be triggered. + +Signed-off-by: Julien Grall <julien.grall@arm.com> +Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org> +[bigeasy@linuxtronix.de: commit description] +Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> +Acked-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> +Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> +Cc: stable-rt@vger.kernel.org +Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> +--- + drivers/tty/sysrq.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/drivers/tty/sysrq.c b/drivers/tty/sysrq.c +index cee0274806c5..f785ca55fb85 100644 +--- a/drivers/tty/sysrq.c ++++ b/drivers/tty/sysrq.c +@@ -215,7 +215,7 @@ static struct sysrq_key_op sysrq_showlocks_op = { + #endif + + #ifdef CONFIG_SMP +-static DEFINE_SPINLOCK(show_lock); ++static DEFINE_RAW_SPINLOCK(show_lock); + + static void showacpu(void *dummy) + { +@@ -225,10 +225,10 @@ static void showacpu(void *dummy) + if (idle_cpu(smp_processor_id())) + return; + +- spin_lock_irqsave(&show_lock, flags); ++ raw_spin_lock_irqsave(&show_lock, flags); + pr_info("CPU%d:\n", smp_processor_id()); + show_stack(NULL, NULL); +- spin_unlock_irqrestore(&show_lock, flags); ++ raw_spin_unlock_irqrestore(&show_lock, flags); + } + + static void sysrq_showregs_othercpus(struct work_struct *dummy) +-- +2.36.1 + |