[lkml]   [2020]   [Dec]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Subject[PATCH next v2 0/3] printk: remove logbuf_lock

Here is a v2 of the next series for the printk-rework. It
removes the @logbuf_lock. v1 is here [0]. Since this lock
protected more than just the ringbuffer, a new
finer-grained @syslog_lock is introduced.

With this series, vprintk_store() becomes lockless.

A consequence of this locklessness is that a buffer for
temporary sprint space is no longer available. To get
around this, vsnprintf() is used to determine the full
length to reserve in the ringbuffer and then the message is
directly sprint'ed to the reserved space.

Since the sprint'ed message may include syslog prefix and
newline (both of which get stripped), there will be some
bytes of wasted space per message. This space could be
reclaimed by introducing a "trimming function" to the
ringbuffer, which could reduce the size of a reserved data
block if no newer block is reserved. However, such a
function is not part of this series.

This series falls in line with the printk-rework plan as
presented [1] at Linux Plumbers in Lisbon 2019.

The series is based on next-20201201.

John Ogness

[1] (slide 23)

John Ogness (3):
printk: inline log_output(),log_store() in vprintk_store()
printk: change @clear_seq to atomic64_t
printk: remove logbuf_lock, add syslog_lock

include/linux/printk.h | 1 +
kernel/printk/internal.h | 4 +-
kernel/printk/printk.c | 411 ++++++++++++++++++------------------
kernel/printk/printk_safe.c | 18 +-
4 files changed, 212 insertions(+), 222 deletions(-)


 \ /
  Last update: 2020-12-01 21:56    [W:0.442 / U:1.968 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site