Skip to content

printk: remove logbuf_lock

John Ogness linux-parisc lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest14 patches 28 repliesIn review

Changes since v1 from the cover letter

- handle the syslog_print_all() size calculation issue in a separate patch (patch 1)

- use a local printk_info for find_first_fitting_seq()

- define CONSOLE_LOG_MAX in printk.c instead of printk.h since it is not used outside of printk.c

- increase CONSOLE_LOG_MAX to 4096 to support long multi-line records

- add a wrapper function read_syslog_seq_irq() for getting a consistent @syslog_seq value (only used in do_syslog())

- drop the "hv: synchronize kmsg_dumper" patch

- in "remove logbuf_lock" only change to safe buffer usage

- fixup safe buffer usage and redundance in separate patches (patches 13 and 14)

- update comments and commit messages as requested

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/14printk: limit second loop of syslog_print_allkernel/printk/printk.c+8 -11 reply
2/14printk: kmsg_dump: remove unused fieldsinclude/linux/kmsg_dump.h+3 -21 reply
3/14printk: refactor kmsg_dump_get_buffer()include/linux/kmsg_dump.h kernel/printk/printk.c+33 -290 replies
4/14printk: consolidate kmsg_dump_get_buffer/syslog_print_all codekernel/printk/printk.c+50 -371 reply
5/14printk: introduce CONSOLE_LOG_MAX for improved multi-line supportkernel/printk/printk.c+11 -71 reply
6/14printk: use seqcount_latch for clear_seqkernel/printk/printk.c+50 -80 replies
7/14printk: use atomic64_t for devkmsg_user.seqkernel/printk/printk.c+12 -121 reply
8/14printk: add syslog_lockkernel/printk/printk.c+37 -411 replies
9/14printk: introduce a kmsg_dump iteratorarch/powerpc/kernel/nvram_64.c arch/powerpc/platforms/powernv/opal-kmsg.c arch/powerpc/xmon/xmon.c +7 more+84 -758 replies
10/14um: synchronize kmsg_dumperarch/um/kernel/kmsg_dump.c+8 -00 replies
11/14printk: remove logbuf_lockkernel/printk/internal.h kernel/printk/printk.c kernel/printk/printk_safe.c+47 -1021 reply
12/14printk: kmsg_dump: remove _nolock() variantsarch/powerpc/xmon/xmon.c include/linux/kmsg_dump.h kernel/debug/kdb/kdb_main.c +1 more+15 -751 reply
13/14printk: kmsg_dump: use kmsg_dump_rewindkernel/printk/printk.c+1 -51 reply
14/14printk: console: remove unnecessary safe buffer usagekernel/printk/printk.c+3 -71 reply

Reviews trailers per patch

13 of 14 patches have a Reviewed-by or Acked-by.

PatchPetr MladekMichael Kelley
1/14R-b
2/14R-b
3/14R-b
4/14R-b
5/14R-b
6/14R-b
7/14R-b
8/14
9/14R-b R-b
10/14R-b
11/14R-b
12/14R-b
13/14R-b
14/14R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH printk-rework 00/14] printk: remove logbuf_lock

Hello,

Here is v2 of a series to remove @logbuf_lock, exposing the ringbuffer locklessly to both readers and writers. v1 is here [0].

Since @logbuf_lock was protecting much more than just the ringbuffer, this series clarifies and cleans up the various protections using comments, lockless accessors, atomic types, and a new finer-grained @syslog_log.

Changes since v1:

- handle the syslog_print_all() size calculation issue in a separate patch (patch 1)

- use a local printk_info for find_first_fitting_seq()

- define CONSOLE_LOG_MAX in printk.c instead of printk.h since it is not used outside of printk.c

- increase CONSOLE_LOG_MAX to 4096 to support long multi-line records

- add a wrapper function read_syslog_seq_irq() for getting a consistent @syslog_seq value (only used in do_syslog())

- drop the "hv: synchronize kmsg_dumper" patch

- in "remove logbuf_lock" only change to safe buffer usage

- fixup safe buffer usage and redundance in separate patches (patches 13 and 14)

- update comments and commit messages as requested

John Ogness

[0] https://lkml.kernel.org/r/[email protected]

John Ogness (14):
printk: limit second loop of syslog_print_all
printk: kmsg_dump: remove unused fields
printk: refactor kmsg_dump_get_buffer()
printk: consolidate kmsg_dump_get_buffer/syslog_print_all code
printk: introduce CONSOLE_LOG_MAX for improved multi-line support
printk: use seqcount_latch for clear_seq
printk: use atomic64_t for devkmsg_user.seq
printk: add syslog_lock
printk: introduce a kmsg_dump iterator
um: synchronize kmsg_dumper
printk: remove logbuf_lock
printk: kmsg_dump: remove _nolock() variants
printk: kmsg_dump: use kmsg_dump_rewind
printk: console: remove unnecessary safe buffer usage

 arch/powerpc/kernel/nvram_64.c             |  12 +-
 arch/powerpc/platforms/powernv/opal-kmsg.c |   3 +-
 arch/powerpc/xmon/xmon.c                   |   6 +-
 arch/um/kernel/kmsg_dump.c                 |  13 +-
 drivers/hv/vmbus_drv.c                     |   5 +-
 drivers/mtd/mtdoops.c                      |   5 +-
 fs/pstore/platform.c                       |   5 +-
 include/linux/kmsg_dump.h                  |  52 +--
 kernel/debug/kdb/kdb_main.c                |  10 +-
 kernel/printk/internal.h                   |   4 +-
 kernel/printk/printk.c                     | 454 +++++++++++----------
 kernel/printk/printk_safe.c                |  29 +-
 12 files changed, 298 insertions(+), 300 deletions(-)
Signature · 1 line
2.20.1