Hello, Here is v3 for the second series to rework the printk subsystem. (The v2 is here [0].) This series implements a new ringbuffer feature that allows the last record to be extended. Petr Mladek provided the initial proof of concept [1] for this. Using the record extension feature, LOG_CONT is re-implemented in a way that exactly preserves its behavior, but avoids the need for an extra buffer. In particular, it avoids the need for any synchronization that such a buffer requires. This series deviates from the agreements [2] made at the meeting during LPC2019 in Lisbon. The test results of the v1 series, which implemented LOG_CONT as agreed upon, showed that the effects on existing userspace tools using /dev/kmsg (journalctl, dmesg) were not acceptable [3]. The main difference to v2 is the implementation of the new descriptor finalization. For v3 the implementation closely follows the example [4] from Petr Mladek. Patch 6 introduces *four* new memory barrier pairs. Two of them are insignificant additions (data_realloc:A/desc_read:D and data_realloc:A/data_push_tail:B) because they are alternate path memory barriers that exactly match the purpose and context of the two existing memory barrier pairs they provide an alternate path for. The other two new memory barrier pairs are significant additions: desc_reopen_last:A/_prb_commit:B - When reopening a descriptor, ensure the commit flag is removed before fully trusing the descriptor data. _prb_commit:B / desc_reserve:D - When committing a descriptor, ensure the commit flag is set before checking the head ID to see if the finalize flag should be set. Patch 8 assumes the gdb script series [5] for the new printk ringbuffer has been applied. The test module used to test the ringbuffer is available here [6]. The series is based on next-20200828. The list of changes since v2: printk_ringbuffer ================= - prb_commit(): finalize self if no longer the head - prb_reserve(): clear @info fields on success - prb_reserve(): do not finalize the -1 placeholder descriptor - desc_make_final(): renamed from desc_finalize() - desc_make_final(): remove loop, change to single shot attempt - prb_reserve_in_last(): renamed from prb_reserve_last() - prb_reserve_in_last(): add new fail goto target - prb_reserve_in_last(): fix logic for calculating @text_buf_size and add size check - desc_reopen_last(): add extra caller ID check before reopening - desc_reopen_last(): change cmpcxhg() to full memory barrier - get_desc_state(): remove unneeded @is_final argument - documentation: update finalization, sample code, and memory barrier list printk.c ======== - set @text_len and @dict_len as required by prb_reserve() change John Ogness [0] https://lkml.kernel.org/r/20200824103538.31446-1-john.ogness@xxxxxxxxxxxxx [1] https://lkml.kernel.org/r/20200812163908.GH12903@alley [2] https://lkml.kernel.org/r/87k1acz5rx.fsf@xxxxxxxxxxxxx [3] https://lkml.kernel.org/r/20200811160551.GC12903@alley [4] https://lkml.kernel.org/r/20200827151710.GB4928@alley [5] https://lkml.kernel.org/r/CAHk-=wj_b6Bh=d-Wwh0xYqoQBhHkYeExhszkpxdRA6GjTvkRiQ@xxxxxxxxxxxxxx [6] https://lkml.kernel.org/r/20200814212525.6118-1-john.ogness@xxxxxxxxxxxxx [7] https://github.com/Linutronix/prb-test.git John Ogness (8): printk: ringbuffer: rename DESC_COMMITTED_MASK flag printk: ringbuffer: change representation of reusable printk: ringbuffer: relocate get_data() printk: ringbuffer: add BLK_DATALESS() macro printk: ringbuffer: clear initial reserved fields printk: ringbuffer: add finalization/extension support printk: reimplement log_cont using record extension scripts/gdb: support printk finalized records Documentation/admin-guide/kdump/gdbmacros.txt | 10 +- kernel/printk/printk.c | 105 +-- kernel/printk/printk_ringbuffer.c | 604 +++++++++++++++--- kernel/printk/printk_ringbuffer.h | 12 +- scripts/gdb/linux/dmesg.py | 10 +- 5 files changed, 558 insertions(+), 183 deletions(-) -- 2.20.1 _______________________________________________ kexec mailing list kexec@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/kexec