Re: [PATCH v6 1/2] printk: Factor out buffering and irq work queuing in printk_deferred

From: Sergey Senozhatsky
Date: Sun Mar 13 2016 - 21:20:39 EST


Hello Byungchul,

Sorry, I'll make sure I Cc you next time. Jan Kara's updated patch set

http://marc.info/?l=linux-kernel&m=145787625506342

it's quite close to what you have done in this patch, but Jan's
patch also solves a number of more likely to happen cases.

have time to take a look?

the lock debug patch in your series is different. can we settle
down async printk first and then return to it? it's not so simple...


On (03/11/16 19:37), Byungchul Park wrote:
[..]
> int printk_deferred(const char *fmt, ...)
> {
> va_list args;
> int r;
>
> preempt_disable();
> +
> va_start(args, fmt);
> - r = vprintk_emit(0, LOGLEVEL_SCHED, NULL, 0, fmt, args);
> + r = vprintk_deferred(fmt, args);
> va_end(args);
> + printk_pending_output();
>
> - __this_cpu_or(printk_pending, PRINTK_PENDING_OUTPUT);
> - irq_work_queue(this_cpu_ptr(&wake_up_klogd_work));
> preempt_enable();
>
> return r;

vprintk_deferred() does vprintk_emit()->{spin_lock()} again? cosole_lock() is
moved out of sight, but logbug_lock is still there. wouldn't this (in the worst
case) result in endless loop after all? sorry if I'm missing something.

-ss