Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

printk: ringbuffer: fix errors in comments

The printk ringbuffer implementation is described in the comment as
using three ringbuffers, but the current implementation uses two (desc
and data). Update the comment so it matches the code.

Fix few more known issues in the comments.

Signed-off-by: Loïc Grégoire <loicgre@gmail.com>
Reviewed-by: John Ogness <john.ogness@linutronix.de>
Link: https://patch.msgid.link/20260328021855.53956-1-loicgre@gmail.com
[pmladek@suse.com: Fixed few more issues in the comments by John Ogness.]
Signed-off-by: John Ogness <john.ogness@linutronix.de>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Signed-off-by: Petr Mladek <pmladek@suse.com>

authored by

Loïc Grégoire and committed by
Petr Mladek
bf56987c 407f666d

+7 -7
+6 -6
kernel/printk/printk_ringbuffer.c
··· 14 14 * 15 15 * Data Structure 16 16 * -------------- 17 - * The printk_ringbuffer is made up of 3 internal ringbuffers: 17 + * The printk_ringbuffer is made up of 2 internal ringbuffers: 18 18 * 19 19 * desc_ring 20 20 * A ring of descriptors and their meta data (such as sequence number, ··· 224 224 * 225 225 * prb_rec_init_rd(&r, &info, &text_buf[0], sizeof(text_buf)); 226 226 * 227 - * prb_for_each_record(0, &test_rb, &seq, &r) { 227 + * prb_for_each_record(0, &test_rb, seq, &r) { 228 228 * if (info.seq != seq) 229 229 * pr_warn("lost %llu records\n", info.seq - seq); 230 230 * ··· 1368 1368 * 1369 1369 * WMB from _prb_commit:A to _prb_commit:B 1370 1370 * matching 1371 - * MB If desc_reopen_last:A to prb_reserve_in_last:A 1371 + * MB from desc_reopen_last:A to prb_reserve_in_last:A 1372 1372 */ 1373 1373 if (!atomic_long_try_cmpxchg(&d->state_var, &prev_state_val, 1374 1374 DESC_SV(id, desc_reserved))) { /* LMM(desc_reopen_last:A) */ ··· 1773 1773 * 1774 1774 * Relies on: 1775 1775 * 1776 - * MB _prb_commit:B to prb_commit:A 1776 + * MB from _prb_commit:B to prb_commit:A 1777 1777 * matching 1778 - * MB desc_reserve:D to desc_make_final:A 1778 + * MB from desc_reserve:D to desc_make_final:A 1779 1779 */ 1780 1780 if (!atomic_long_try_cmpxchg(&d->state_var, &prev_state_val, 1781 1781 DESC_SV(e->id, state_val))) { /* LMM(_prb_commit:B) */ ··· 2038 2038 * 2039 2039 * MB from desc_push_tail:B to desc_reserve:F 2040 2040 * matching 2041 - * RMB prb_first_seq:B to prb_first_seq:A 2041 + * RMB from prb_first_seq:B to prb_first_seq:A 2042 2042 */ 2043 2043 smp_rmb(); /* LMM(prb_first_seq:C) */ 2044 2044 }
+1 -1
kernel/printk/printk_ringbuffer.h
··· 383 383 * 384 384 * This is a macro for conveniently iterating over a ringbuffer. 385 385 * Note that @s may not be the sequence number of the record on each 386 - * iteration. For the sequence number, @r->info->seq should be checked. 386 + * iteration. For the sequence number, @i->seq should be checked. 387 387 * 388 388 * Context: Any context. 389 389 */