Messages in this thread | | | Date | Wed, 9 Dec 2020 14:31:46 +0900 | From | Sergey Senozhatsky <> | Subject | Re: [PATCH next v4 2/2] printk: remove logbuf_lock writer-protection of ringbuffer |
| |
On (20/12/09 01:50), 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: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
-ss
| |