From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 89A4A3C9EDF for ; Mon, 30 Mar 2026 13:12:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774876345; cv=none; b=mP3NxC9mYzwUmGPoTTDJOL98eTsPa3LPa3M0jDlvyGCbadHqNxNVCqmwDnrn3wMdxOCEwhbigOxqGciUWnCAT+6CFHlpS1zREiUP0cXVnC8WS3GqeZGhaxX04dtE1RJTPVLYCIbrW/zJhiro9O5mOuzI4Ai/1ZcRPI9ci0d2F64= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774876345; c=relaxed/simple; bh=DAER7s/U1wUUNsYjL2xBwdEzG4mMifdsCn7XQGjeSmE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=FZneFJ2KpSk3a6nZRSdbKdbQCIJEjJoJ5Is/JyDAnWX0rxFb0rpYfobB4QvhXxdBMZg1FGFC1RSh2VH2/fwOPjZ/3z4K50I3WuD6E9My9tE9t+SASZ3nVvCmoVF6HOUc2xjzaUrex8LXMXph5x57eXUnjuXEy+dun9iYwjMwehw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=GUKiQJAX; arc=none smtp.client-ip=209.85.128.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="GUKiQJAX" Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-48558d6ef83so44311385e9.3 for ; Mon, 30 Mar 2026 06:12:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1774876342; x=1775481142; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=3BXHfvyNz5LIv4RF+v3cAsSb7Hc/dYHVMBlfNNmJTHw=; b=GUKiQJAXDFVBnJskH4XCTKMLphNhnceyrUGUx3zUSd+eiw84lkabR4GXZzfqJqvonN HKNJUQbA+5NYlozOxfv3FSymb0oGRlZbIaII+cQ2lhLZDgEfNDjtTUU3/Q6MXv+OabPw af7AhwO6/1Hozl+WDOxO5rNZZ9lQ03uUHs0FKem3O6fyuJBPJIdIdBuwDX1wvXmSlwvy FnHp7XPlB97TTzkJeqkUAspmMIQahJrhQ+uICPw+rfx1ZcmndcKq73f8kVLRNGJhUYF2 OO2cYwsjSgmhf9GyDzujl+/c2tb973AzwcS/y/tlhc6Yj+Zc4T58nmbDjXhGgFHqasnp hAgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774876342; x=1775481142; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=3BXHfvyNz5LIv4RF+v3cAsSb7Hc/dYHVMBlfNNmJTHw=; b=MLSfQksDSsfjU7LpNeF9+BmIDqlBJZdIj0IcdZBi9K5Jas0nghH92zLd5lLISHsSUf GkuHgnYB7Yyqj7FeX0qfailvHA+3V9OfBz6AbiutJMbXosyUZqrhdB34srJF80g9UUVp OhMJBP9oUXsuO1j3hXerspHoYQtU7XhwcUSGo5E8tZ7Pea+GAoH5WtCog8Tj6iRBTJlI ANueZa5RvYE8OUlRCYludPOH6VbdaEBPfomTCAYY+kooyFYysOXsSOVMALZ+ZYn0MTYG TSg0U+jq2GCUyHi1sFNprDkD/VVaj13si8nyhF1UYgYhqHZbcD+w0iTTC1sDVFrrhg0k 3QYw== X-Forwarded-Encrypted: i=1; AJvYcCV74sbtaT5pipD71MRqm9UEVHU/QW8AZLBWWa3VmObVAUcIHbYAzInGLq3db5FNsUkzKVtfLruF9KGXQFI=@vger.kernel.org X-Gm-Message-State: AOJu0YxejxMUPQCxpZXUdROziUIwxZtaMCPU0Ay3EONi5XZFJsl9TFjE Cz1lo5/O5d/6ugro60FlwUEPYN6Mht+XbcWN1jeKj6MNL6AelbNzywYxyR/xM9drAUI20lEM3Cr cw11kQgM= X-Gm-Gg: ATEYQzzZHcvJqZjFLTnpM6xP7XTxqF+dT18feuXi7iBMLjRNMbaw6J/1y/EQB8d1Fww votfpxQvFuXv9rOtMbouLTsM9f7v+BVO6K4MTdqa2ZRSRje+tawvpFHc03mDFW6RFtgMKl07kK1 DQbSPxeFDtHlVELPAboZB/SdrdEWyvDLifM9172PkCOWbj1NCXgvX5uP+GJMhYi+G/SHeXpQzft W6JjYfV0eCotx823+9sTp9T5VILZF+LZ11t38U1Z77n4BVT3GmUaiISiPubaQS7cK+y/Q2Rc+vN rgxE4HaedlYKkIthgFWQbH1VSWPVWSSyMb3iianspgehA1gS1AJoUbnIjr0RdZ5kar5Y5xpeaGq eaBqcDXCUNQZ2/RgBZNoC98i8BYUaztjvb7rR0z4duV8NcqyiG3q+gY1TxdSigUG7DnGRuvtxT6 gRx5r/IHeneOKAmDRmtuL28tsUcA== X-Received: by 2002:a05:600c:4e15:b0:477:7ae0:cd6e with SMTP id 5b1f17b1804b1-48727d5a16fmr208272385e9.5.1774876341805; Mon, 30 Mar 2026 06:12:21 -0700 (PDT) Received: from pathway.suse.cz ([176.114.240.130]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48722c957b9sm412866065e9.8.2026.03.30.06.12.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Mar 2026 06:12:21 -0700 (PDT) Date: Mon, 30 Mar 2026 15:12:19 +0200 From: Petr Mladek To: John Ogness Cc: =?iso-8859-1?Q?Lo=EFc_Gr=E9goire?= , Steven Rostedt , Sergey Senozhatsky , open list Subject: Re: [PATCH] printk: ringbuffer: fix error in comment Message-ID: References: <20260328021855.53956-1-loicgre@gmail.com> <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=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <87pl4ln3m7.fsf@jogness.linutronix.de> On Mon 2026-03-30 10:12:08, John Ogness wrote: > On 2026-03-27, Loïc Grégoire 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ïc Grégoire > > Reviewed-by: John Ogness Reviewed-by: Petr Mladek > 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? > > diff --git a/kernel/printk/printk_ringbuffer.c b/kernel/printk/printk_ringbuffer.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 != seq) > * pr_warn("lost %llu records\n", info.seq - seq); > * > @@ -1365,7 +1365,7 @@ static struct prb_desc *desc_reopen_last(struct prb_desc_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_ringbuffer.h > index 1651b53ece34f..fb7d2ee29af23 100644 > --- a/kernel/printk/printk_ringbuffer.h > +++ b/kernel/printk/printk_ringbuffer.h > @@ -388,7 +388,7 @@ for ((s) = from; prb_read_valid(rb, s, r); (s) = (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. > */ All these changes look correct as well: Reviewed-by: Petr Mladek I could squash these changes into the original patch when comitting into printk/linux.git. John, could I use your Signed-off-by to mark you as a co-author and keep Loïc as the author of the patch? Best Regards, Petr