summaryrefslogtreecommitdiffstats
path: root/kernel/printk/printk.c
diff options
context:
space:
mode:
authorPetr Mladek <pmladek@suse.com>2018-06-27 16:08:16 +0200
committerPetr Mladek <pmladek@suse.com>2018-07-09 14:08:13 +0200
commita338f84dc196f44b63ba0863d2f34fd9b1613572 (patch)
tree054a458fe019c4c5fc66cdcf4917b762fb4a6663 /kernel/printk/printk.c
parentprintk: Split the code for storing a message into the log buffer (diff)
downloadlinux-a338f84dc196f44b63ba0863d2f34fd9b1613572.tar.xz
linux-a338f84dc196f44b63ba0863d2f34fd9b1613572.zip
printk: Create helper function to queue deferred console handling
It is just a preparation step. The patch does not change the existing behavior. Link: http://lkml.kernel.org/r/20180627140817.27764-3-pmladek@suse.com To: Steven Rostedt <rostedt@goodmis.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> Cc: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> Cc: linux-kernel@vger.kernel.org Cc: stable@vger.kernel.org Acked-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com> Signed-off-by: Petr Mladek <pmladek@suse.com>
Diffstat (limited to 'kernel/printk/printk.c')
-rw-r--r--kernel/printk/printk.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index a844c611b17c..1d1513215c22 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -2887,16 +2887,20 @@ void wake_up_klogd(void)
preempt_enable();
}
-int vprintk_deferred(const char *fmt, va_list args)
+void defer_console_output(void)
{
- int r;
-
- r = vprintk_emit(0, LOGLEVEL_SCHED, NULL, 0, fmt, args);
-
preempt_disable();
__this_cpu_or(printk_pending, PRINTK_PENDING_OUTPUT);
irq_work_queue(this_cpu_ptr(&wake_up_klogd_work));
preempt_enable();
+}
+
+int vprintk_deferred(const char *fmt, va_list args)
+{
+ int r;
+
+ r = vprintk_emit(0, LOGLEVEL_SCHED, NULL, 0, fmt, args);
+ defer_console_output();
return r;
}