public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/3] printk: replace ringbuffer
@ 2020-06-18 14:49 John Ogness
  2020-06-18 14:49 ` [PATCH v3 1/3] crash: add VMCOREINFO macro to define offset in a struct declared by typedef John Ogness
                   ` (3 more replies)
  0 siblings, 4 replies; 35+ messages in thread
From: John Ogness @ 2020-06-18 14:49 UTC (permalink / raw)
  To: Petr Mladek
  Cc: Peter Zijlstra, Sergey Senozhatsky, Sergey Senozhatsky,
	Steven Rostedt, Linus Torvalds, Greg Kroah-Hartman, Andrea Parri,
	Thomas Gleixner, Paul McKenney, kexec, linux-kernel

Hello,

Here is a v3 for the first series to rework the printk
subsystem. The v2 and history are here [0]. This first series
only replaces the existing ringbuffer implementation. No locking
is removed. No semantics/behavior of printk are changed.

Reviews on the ringbuffer are still ongoing, but I was asked to
post this new version since several changes from v2 have been
already agreed upon.

The series is based on v5.8-rc1.

The list of changes since v2:

printk.c
========

- console_unlock(): fix extended console printing [1]

printk_ringbuffer
=================

- data_push_tail(): fixed handling when another CPU already
  pushed the tail [2]

- desc_push_tail(): added a full memory barrier before the
  descriptor tail push [3]

- data_make_reusable()/data_alloc(): changed block ID
  reading/writing from READ_ONCE()/WRITE_ONCE() to regular
  assignments [4]

- data_make_reusable(): removed unnecessary data tail
  re-check [5]

- general: folded all smp_mb() and smp_wmb() calls into their
  neighboring cmpxchg_relaxed(), changing them to full cmpxchg()
  calls [6]

- desc_read(): changed descriptor content reading from
  READ_ONCE() to memcpy() since it served no purpose for the
  legal data race

- general: cleaned up memory barrier comments; in particular
  made sure that the reader and writer sides of the memory
  barrier pairs match in their descriptions

- added a new section in the memory barrier documentation (near
  the top of printk_ringbuffer.c) that lists all 10 memory
  barrier pairs and briefly describes what they are ordering

- _prb_read_valid(): changed the helper function to static

- general: changed block size argument type from "unsigned long"
  to "unsigned int" since a record's *_buf_size fields are of
  type "unsigned int"

- general: allow some lines to go beyond 80 characters

John Ogness

[0] https://lkml.kernel.org/r/20200501094010.17694-1-john.ogness@linutronix.de
[1] https://lkml.kernel.org/r/87ftcd86d2.fsf@vostro.fn.ogness.net
[2] https://lkml.kernel.org/r/87v9ktcs3q.fsf@vostro.fn.ogness.net
[3] https://lkml.kernel.org/r/87bllpyzgr.fsf@vostro.fn.ogness.net
[4] https://lkml.kernel.org/r/87tuzkuxtw.fsf@vostro.fn.ogness.net
[5] https://lkml.kernel.org/r/87pna5mjtp.fsf@vostro.fn.ogness.net

John Ogness (3):
  crash: add VMCOREINFO macro to define offset in a struct declared by
    typedef
  printk: add lockless ringbuffer
  printk: use the lockless ringbuffer

 include/linux/crash_core.h        |    3 +
 include/linux/kmsg_dump.h         |    2 -
 kernel/printk/Makefile            |    1 +
 kernel/printk/printk.c            |  944 ++++++++--------
 kernel/printk/printk_ringbuffer.c | 1674 +++++++++++++++++++++++++++++
 kernel/printk/printk_ringbuffer.h |  352 ++++++
 6 files changed, 2527 insertions(+), 449 deletions(-)
 create mode 100644 kernel/printk/printk_ringbuffer.c
 create mode 100644 kernel/printk/printk_ringbuffer.h

-- 
2.20.1


^ permalink raw reply	[flat|nested] 35+ messages in thread

end of thread, other threads:[~2020-07-08  5:51 UTC | newest]

Thread overview: 35+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-06-18 14:49 [PATCH v3 0/3] printk: replace ringbuffer John Ogness
2020-06-18 14:49 ` [PATCH v3 1/3] crash: add VMCOREINFO macro to define offset in a struct declared by typedef John Ogness
2020-06-24  8:49   ` Petr Mladek
2020-07-04  9:30   ` Baoquan He
2020-06-18 14:49 ` [PATCH v3 2/3] printk: add lockless ringbuffer John Ogness
2020-06-29 15:32   ` Paul E. McKenney
2020-07-02  8:35   ` Petr Mladek
2020-06-18 14:49 ` [PATCH v3 3/3] printk: use the " John Ogness
2020-06-18 18:23   ` kernel test robot
2020-06-18 18:23   ` [RFC PATCH] printk: _printk_rb_static_dict can be static kernel test robot
2020-06-19  6:49     ` John Ogness
2020-06-19 12:29       ` Steven Rostedt
2020-06-25  8:16   ` truncate dict: was: Re: [PATCH v3 3/3] printk: use the lockless ringbuffer Petr Mladek
2020-06-26 13:48     ` John Ogness
2020-06-25  8:28   ` buffer allocation: was: " Petr Mladek
2020-06-26 15:02     ` John Ogness
2020-06-29 14:04       ` Petr Mladek
2020-06-29 21:57         ` John Ogness
2020-07-02 13:27           ` Petr Mladek
2020-06-25 12:09   ` record_printk_text tricks: " Petr Mladek
2020-06-25 15:25     ` Petr Mladek
2020-06-26 23:25     ` John Ogness
2020-06-25 15:17   ` pending output optimization: " Petr Mladek
2020-07-01 19:58     ` John Ogness
2020-06-25 15:20   ` syslog size unread: " Petr Mladek
2020-06-29 21:51     ` John Ogness
2020-07-02  8:25   ` lijiang
2020-07-02  9:02     ` John Ogness
2020-07-02  9:43       ` lijiang
2020-07-02 13:31         ` Petr Mladek
2020-07-04  1:12           ` lijiang
2020-07-03 11:54         ` John Ogness
2020-07-08  5:50           ` lijiang
2020-06-25  7:19 ` [PATCH v3 0/3] printk: replace ringbuffer Dave Young
2020-06-25 14:13   ` John Ogness

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox