From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 768782C159A for ; Mon, 30 Mar 2026 08:06:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774857971; cv=none; b=MG6KT3xoEbWTjY9MyA1iR1dJkEsC7keGgZyUnygExA7+2fnwPiVSPmU6mMQS97Gd9ww8t6RlYbywEJ01weEw5HlJaVv8MgH4mpfK6MvNlTXel4t/4Qrn/lHnw7dRdlP3G1VBhtfmlJ6zfk/DX9OZMdvHibfOpRYceyv2NI/Bmr4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774857971; c=relaxed/simple; bh=460ieqYcBLUq2nm/61q15nQn49HYTu+aZFiOYvOZ8QE=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=HZK2eGbYYxIm5w4fv08oSJJ5anFYR+icexf4qFNKHCmMZa/y9d/ty/Gw760XmpTgmWQxqf5Jx9FwJVP9boNh84KJbtx4R1OM4EgZJMj6P6aIiqz1ZpE/JT09ioPoDqIY3a/9U7OoS+FLORFHFCvRBKRL7GTsKnocDbLxToypsjY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=Xfq6fJXb; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=j5wBDBtS; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="Xfq6fJXb"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="j5wBDBtS" From: John Ogness DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1774857968; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=nFO2PEWsgCo8fXW/2enJvp+HdovJ7zMj/AATcc3vWEg=; b=Xfq6fJXbt3nlBqr2DVy3JUgW4iXj0C5wcFCzBie2QrSvJ1kRJ7GXuiQUThhpt8lQfHULIu bA3kVvxmckiXt2B3c3+43UCcFRe0FPwPGQfBM/GCB+dTcS55WmJDo/cMALqKKOGNP37cKC TSKkUuDFp+omwy1Q/hpXspvSuXuwihMr5W+5SVbZingVIv38mvouTO655MheTod0Jh7tEF rb/BWswFm020Jaduq4+HKKb9ORPe2BVOr9TCILotG//g36pi4kgh7T9EruTmU1Oq0yYXp5 UMzptce+Jc7/tchlVEtP89zhc1uEJ+i9Dw294oj93tn6EMc5pJt094x9Lay/eQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1774857968; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=nFO2PEWsgCo8fXW/2enJvp+HdovJ7zMj/AATcc3vWEg=; b=j5wBDBtSs4RuMWZtx7g3JAQ7B6phCh8rfUw7us8t3bI0FzRS9Z8uj0eEgkt4Iyp7D762S8 Z2C9ogEBjoYxEZDQ== To: =?utf-8?Q?Lo=C3=AFc_Gr=C3=A9goire?= , Petr Mladek , Steven Rostedt , Sergey Senozhatsky , open list Cc: =?utf-8?Q?Lo=C3=AFc_Gr=C3=A9goire?= Subject: Re: [PATCH] printk: ringbuffer: fix error in comment In-Reply-To: <20260328021855.53956-1-loicgre@gmail.com> References: <20260328021855.53956-1-loicgre@gmail.com> Date: Mon, 30 Mar 2026 10:12:08 +0206 Message-ID: <87pl4ln3m7.fsf@jogness.linutronix.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 2026-03-27, Lo=C3=AFc Gr=C3=A9goire wrote: > 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. > > Signed-off-by: Lo=C3=AFc Gr=C3=A9goire Reviewed-by: John Ogness However, this is only a single fixup when there are other documentation errors that need fixing as well. Does it make sense to commit such tiny fixups separately? For example, below are needed fixes that I am aware of. Perhaps we should fold these into a single doc-fixup patch? John diff --git a/kernel/printk/printk_ringbuffer.c b/kernel/printk/printk_ringb= uffer.c index 56c8e3d031f49..3f019207d2688 100644 --- a/kernel/printk/printk_ringbuffer.c +++ b/kernel/printk/printk_ringbuffer.c @@ -224,7 +224,7 @@ * * prb_rec_init_rd(&r, &info, &text_buf[0], sizeof(text_buf)); * - * prb_for_each_record(0, &test_rb, &seq, &r) { + * prb_for_each_record(0, &test_rb, seq, &r) { * if (info.seq !=3D seq) * pr_warn("lost %llu records\n", info.seq - seq); * @@ -1365,7 +1365,7 @@ static struct prb_desc *desc_reopen_last(struct prb_d= esc_ring *desc_ring, * * WMB from _prb_commit:A to _prb_commit:B * matching - * MB If desc_reopen_last:A to prb_reserve_in_last:A + * MB from desc_reopen_last:A to prb_reserve_in_last:A */ if (!atomic_long_try_cmpxchg(&d->state_var, &prev_state_val, DESC_SV(id, desc_reserved))) { /* LMM(desc_reopen_last:A) */ @@ -1770,9 +1770,9 @@ static void _prb_commit(struct prb_reserved_entry *e,= unsigned long state_val) * * Relies on: * - * MB _prb_commit:B to prb_commit:A + * MB from _prb_commit:B to prb_commit:A * matching - * MB desc_reserve:D to desc_make_final:A + * MB from desc_reserve:D to desc_make_final:A */ if (!atomic_long_try_cmpxchg(&d->state_var, &prev_state_val, DESC_SV(e->id, state_val))) { /* LMM(_prb_commit:B) */ @@ -2035,7 +2035,7 @@ u64 prb_first_seq(struct printk_ringbuffer *rb) * * MB from desc_push_tail:B to desc_reserve:F * matching - * RMB prb_first_seq:B to prb_first_seq:A + * RMB from prb_first_seq:B to prb_first_seq:A */ smp_rmb(); /* LMM(prb_first_seq:C) */ } diff --git a/kernel/printk/printk_ringbuffer.h b/kernel/printk/printk_ringb= uffer.h index 1651b53ece34f..fb7d2ee29af23 100644 --- a/kernel/printk/printk_ringbuffer.h +++ b/kernel/printk/printk_ringbuffer.h @@ -388,7 +388,7 @@ for ((s) =3D from; prb_read_valid(rb, s, r); (s) =3D (r= )->info->seq + 1) * * This is a macro for conveniently iterating over a ringbuffer. * Note that @s may not be the sequence number of the record on each - * iteration. For the sequence number, @r->info->seq should be checked. + * iteration. For the sequence number, @i->seq should be checked. * * Context: Any context. */