From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) (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 05F86401496 for ; Tue, 31 Mar 2026 15:57:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774972623; cv=none; b=jqeKJzhHL0scsZ3tSUZyY1yIyQVyDnT8cWD+aUylm1FeSKz3w5zLUpPs7EhplQfM98yvoqr1Ew5oaqsvCqcry9bWR386XDpZgzZ83Wc5QGanFiQkGvmKlgb/jxni7ofaMKLeFXJN91KZNZWm/9JR1uNDWXXCporHgCupLxX18Fg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774972623; c=relaxed/simple; bh=gXUzCx2Umd08REToSQZZJudzKax4415/hTV32pCZtPs=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=FGnF7wsINOjjZaAtCTb3S60PF5ZI2ujtywqiInZI7AVBczTMEUVhWUfaVDI9krcOlImuJloCt9HgJkxje+FLv6ld7+r9zMw1NoHJz+v3cBUYUgdGnNqcLA1LiI9WZi9juHlk1Be/MDBPQXdrnNNhwETjttJlrmMkdQCYiBPF4hY= 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=RWrH+9AM; arc=none smtp.client-ip=209.85.128.46 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="RWrH+9AM" Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-48700b1ba53so54044585e9.1 for ; Tue, 31 Mar 2026 08:57:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1774972620; x=1775577420; 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=Z7Q28G7eR7YM05WWrtdyiUO3GlNGUerEADTNJbR6+qg=; b=RWrH+9AMHg+2vfPtmusEu9OFg+8ohgNzpTegQZ7aGydN+E3+VjZoCD9h0MBYNXEz6S ojUvwO7SctvNFyJM5+utizZ9RHjnBsFW4xNZI5Yp7vaJpbehIerQIEPLMgg3pUiVuDfD Q6ZzbuRdZ+0T+4PLX99RPN1NV/p0o/JO1dMNmqNtKxPQkqgdANEpWgW+p8LQcukc49/b ZA5EQjBxCCH825IDzl9GtyLQnkZklAzeORG77Q4VEk4Dg7FDXQbHB9OgMC73WPv13jpU OEo6K9+OgHCH9ErWFfW45CJopOgszYl7/w4tEFNGbjW6keM2AIw8t8DeLWHI901ihLnk RAYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774972620; x=1775577420; 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=Z7Q28G7eR7YM05WWrtdyiUO3GlNGUerEADTNJbR6+qg=; b=ZfjEZu+AW6aZQfF364LM8qtwDv5LrZy1njh9Gr04NR+JuyXm3JCXL9V+Pet9jUAPYl sWhmrzmdLlMh2R/5Ga65RMHaom+ZCKMhDVDF3OhvsbjG/JPnFqHY+0vEMVl++fgfCrKb oellHg/DNJ9fIEWYTFoTKR7XKz+TPJfDn925UDVocjrPTHmvZnCrqHT4TG8A/usnFqq/ 6JOQdNYiwqAtN0LRHikB2SZv8XUtWlUzFnFIHT/ewz1lcBZ/FK8WcW/a7BWBhPs0hKyr QN8dZm5JL+s90G7s+LH67/mNL985FQ4Nz2TxoQTvCoQz1MO7ghyrlLf06iwoO/YUaW1h EVJw== X-Forwarded-Encrypted: i=1; AJvYcCUGCoYzrsFMpasHIwKQWhTm7eqb0pjvbDdd6AZTmFuA8vZ/+6mt/U7XVxUubyMy5PbtVj2HC4WXisQPg9U=@vger.kernel.org X-Gm-Message-State: AOJu0YxXCYmCm81/ANIN5LPDpxcs8HKTsXRfb0upgrlqb5RRWKWsxIp6 s4z8uPDxeW+5SORWsWguG0qOA1C7wZzDFvblMMllf+h69XBqgBNWcPaSfBi4qid/lCk= X-Gm-Gg: ATEYQzwecJTSYGXV/aVWrD7bI6bLPFH08L/FS63qYNMxAjIqM8BnoGsijfWairPivsS hTkcxr4hdJ/xeVqR+U7fyhwM+2mEfn1NS4tH+eS0bo2giRWDnho9gd+EbqRqeAXoQa0bxodnfxO VpCnkFunO+tnKEwjiRGMn2X2Xc4xyi0BXZZRXxf42k5Z7LNkekitVterE7MSMCzRB+g1PeGDGb5 i6gsrznnON6L0qfBBVKG4OYvgcVG2CMPZHhPucz2K77LMAFIINfRDYy1d3CJ6ZfsKUz5F3BzfnJ 4U3qjloTUXaOHDkn7MIhMK40XED9uInEIv6tTnVNFi59OktVowM4mzbNOXkLjaLEWXirdGiIy65 Xg5ZGVqpVd3hrQxUr399S0KXdcU7Pue79kE+tagRlzmxr3odPeWmH0eP5A0qMr2XlH7Lb7ggBBe 5fIOS/z79NsMs6r9eWASCtdSKnbs9CxDiTKw/o X-Received: by 2002:a05:600c:5249:b0:487:386:3714 with SMTP id 5b1f17b1804b1-48727f7bb08mr313192225e9.17.1774972620176; Tue, 31 Mar 2026 08:57:00 -0700 (PDT) Received: from pathway.suse.cz ([176.114.240.130]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4887e72da6csm92830025e9.0.2026.03.31.08.56.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Mar 2026 08:56:59 -0700 (PDT) Date: Tue, 31 Mar 2026 17:56:57 +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> <87mrzpmmk0.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: <87mrzpmmk0.fsf@jogness.linutronix.de> On Mon 2026-03-30 16:20:39, John Ogness wrote: > On 2026-03-30, Petr Mladek wrote: > > 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? > > Signed-off-by: John Ogness JFYI, the patch has been comitted into printk/linux.git, branch rework/prb-fixes. I have merged the extra fixes proposed by John, see https://git.kernel.org/pub/scm/linux/kernel/git/printk/linux.git/commit/?h=rework/prb-fixes&id=bf56987c111372a54ae877934a42f7fb0953a6ca Best Regards, Petr