Thread (17 messages) 17 messages, 5 authors, 2017-01-25

Re: [PATCH] printk: Correctly handle preemption in console_unlock()

From: Sergey Senozhatsky <hidden>
Date: 2017-01-16 13:44:02
Also in: lkml

On (01/16/17 22:26), Sergey Senozhatsky wrote:
On (01/16/17 13:48), Petr Mladek wrote:
[..]
quoted
The async printk code looks like this:

vprintk_emit(...)
{


		if (can_printk_async()) {
			/* Offload printing to a schedulable context. */
			printk_kthread_need_flush_console = true;
			wake_up_process(printk_kthread);
		} else {
			/*
			 * Try to acquire and then immediately release the
			 * console semaphore.  The release will print out
			 * buffers and wake up /dev/kmsg and syslog() users.
			 */
			if (console_trylock())
				console_unlock();
		}

So, there is still the console_trylock() for the sync mode. Or do I
see an outdated variant?
no, it doesn't.
I meant that none of this is happening in vprintk_emit(). there is no
console_sem in vprintk_emit() at all. eveything is done in deferred printk.

	-ss
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help