WARNING: this is a hack to support debugging. For CONFIG_PREEMPT_RT_FULL console_trylock_for_printk() will not attempt to lock the console if: !early_boot_irqs_disabled && !irqs_disabled_flags(flags) && !preempt_count() thus vprintk() will not print out the buffers. Allow console_trylock_for_printk() attempt to lock the console if sysrq_in_progress. This hack patch sets oops_in_progress so that sysrq output can maybe get delivered to the console without delay. Using oops_in_progress is important because that also affects the locking methods used by the serial driver. --- kernel/printk.c | 5 3 + 2 - 0 ! 1 file changed, 3 insertions(+), 2 deletions(-) Index: b/kernel/printk.c =================================================================== --- a/kernel/printk.c +++ b/kernel/printk.c @@ -824,8 +824,9 @@ static int console_trylock_for_printk(un __releases(&logbuf_lock) { #ifdef CONFIG_PREEMPT_RT_FULL - int lock = !early_boot_irqs_disabled && !irqs_disabled_flags(flags) && - !preempt_count(); + int lock = oops_in_progress || + (!early_boot_irqs_disabled && !irqs_disabled_flags(flags) && + !preempt_count()); #else int lock = 1; #endif --- drivers/tty/sysrq.c | 3 3 + 0 - 0 ! 1 file changed, 3 insertions(+) Index: b/drivers/tty/sysrq.c =================================================================== --- a/drivers/tty/sysrq.c +++ b/drivers/tty/sysrq.c @@ -499,6 +499,8 @@ void __handle_sysrq(int key, bool check_ int i; unsigned long flags; +int save_oops_in_progress = oops_in_progress; +oops_in_progress = 1; spin_lock_irqsave(&sysrq_key_table_lock, flags); /* * Raise the apparent loglevel to maximum so that the sysrq header @@ -542,6 +544,7 @@ void __handle_sysrq(int key, bool check_ console_loglevel = orig_log_level; } spin_unlock_irqrestore(&sysrq_key_table_lock, flags); +oops_in_progress = save_oops_in_progress; } void handle_sysrq(int key)