lkml.org 
[lkml]   [2020]   [Dec]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH next v4 2/2] printk: remove logbuf_lock writer-protection of ringbuffer
On Wed 2020-12-09 01:50:53, John Ogness wrote:
> Since the ringbuffer is lockless, there is no need for it to be
> protected by @logbuf_lock. Remove @logbuf_lock writer-protection of
> the ringbuffer. The reader-protection is not removed because some
> some variables used by readers are using @logbuf_lock for
> synchronization: @syslog_seq, @syslog_time, @syslog_partial,
> @console_seq, struct kmsg_dumper.
>
> For PRINTK_NMI_DIRECT_CONTEXT_MASK, @logbuf_lock usage is not removed
> because it may be used for dumper synchronization.
>
> Without @logbuf_lock synchronization of vprintk_store() it is no
> longer possible to use the single static buffer for temporarily
> sprint'ing the message. Instead, use vsnprintf() to determine the
> length and perform the real vscnprintf() using the area reserved from
> the ringbuffer. This leads to suboptimal packing of the message data,
> but will result in less wasted storage than multiple per-cpu buffers
> to support lockless temporary sprint'ing.
>
> Signed-off-by: John Ogness <john.ogness@linutronix.de>

Reviewed-by: Petr Mladek <pmladek@suse.com>

Best Regards,
Petr

\
 
 \ /
  Last update: 2020-12-09 12:15    [W:0.139 / U:0.084 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site