Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 81954606 authored by John Stultz's avatar John Stultz Committed by Linus Torvalds
Browse files

printk: disable preemption for printk_sched



An earlier change in -mm (printk: remove separate printk_sched
buffers...), removed the printk_sched irqsave/restore lines since it was
safe for current users.  Since we may be expanding usage of
printk_sched(), disable preepmtion for this function to make it more
generally safe to call.

Signed-off-by: default avatarJohn Stultz <john.stultz@linaro.org>
Reviewed-by: default avatarJan Kara <jack@suse.cz>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Jiri Bohac <jbohac@suse.cz>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 458df9fd
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -2590,12 +2590,14 @@ int printk_sched(const char *fmt, ...)
	va_list args;
	int r;

	preempt_disable();
	va_start(args, fmt);
	r = vprintk_emit(0, SCHED_MESSAGE_LOGLEVEL, NULL, 0, fmt, args);
	va_end(args);

	__this_cpu_or(printk_pending, PRINTK_PENDING_OUTPUT);
	irq_work_queue(&__get_cpu_var(wake_up_klogd_work));
	preempt_enable();

	return r;
}