[lkml]   [2019]   [Jul]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Subject[RFC PATCH v3 0/2] printk: new ringbuffer implementation

This is a follow-up RFC on the work to re-implement much of
the core of printk. The threads for the previous RFC versions
are here: v1[0], v2[1].

As was planned[2], this is only the first piece: a new
lockless ringbuffer.

Changes from v2:

- Moved all code into kernel/printk/. Let's keep it private
for now.

- Split the ringbuffer into 3 components:

* a data ringbuffer (dataring) to manage the raw data and
data descriptors

* a numbered list (numlist) to manage committed entries and
their sequence numbers

* the printk_ringbuffer, which is the high-level structure
providing the reader/writer API and glue for the other

Splitting the components apart helped to document their
roles and their related memory barriers (and will hopefully
also simplify the review process).

- Renamed most functions, structures, and variables based on
v2 feedback.

- Rewrote and reformatted nearly all comments (particularly
the memory barrier comments) based on v2 feedback.

- Addressed implementation issues with v2:

* invalid data blocks potentially becoming valid because of

* weak associations between data blocks and descriptors

* excessive freeing of data blocks due to unavailable

- Improved error handling and data integrity checks in the test

For the memory barrier work I wrote a litmus test for nearly
every memory barrier. I did not include these in the series.
Should I? If yes, where should they be placed?

I would like to point out that Petr Mladek posted a
proof-of-concept[3] alternate implementation. I wanted to base my
v3 on his work, but ran into too many problems getting it to
run acceptably. I will address those issues in that thread. This
is why my v3 is based directly on my v2.

John Ogness


John Ogness (2):
printk-rb: add a new printk ringbuffer implementation
printk-rb: add test module

kernel/printk/Makefile | 5 +
kernel/printk/dataring.c | 761 ++++++++++++++++++++++++++++++++++++++++++
kernel/printk/dataring.h | 95 ++++++
kernel/printk/numlist.c | 375 +++++++++++++++++++++
kernel/printk/numlist.h | 72 ++++
kernel/printk/ringbuffer.c | 800 +++++++++++++++++++++++++++++++++++++++++++++
kernel/printk/ringbuffer.h | 288 ++++++++++++++++
kernel/printk/test_prb.c | 256 +++++++++++++++
8 files changed, 2652 insertions(+)
create mode 100644 kernel/printk/dataring.c
create mode 100644 kernel/printk/dataring.h
create mode 100644 kernel/printk/numlist.c
create mode 100644 kernel/printk/numlist.h
create mode 100644 kernel/printk/ringbuffer.c
create mode 100644 kernel/printk/ringbuffer.h
create mode 100644 kernel/printk/test_prb.c


 \ /
  Last update: 2019-07-27 03:34    [W:0.039 / U:9.888 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site