Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3891668rdg; Wed, 18 Oct 2023 08:51:20 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF/E22077tYC3Hnmo+hCs3SysyjV3FeLDtjUbzOtJruppaI2tyyY4KNqxeEm70U8hPaOQFE X-Received: by 2002:a05:6a00:2d05:b0:690:fd48:1aa4 with SMTP id fa5-20020a056a002d0500b00690fd481aa4mr8861326pfb.0.1697644279674; Wed, 18 Oct 2023 08:51:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697644279; cv=none; d=google.com; s=arc-20160816; b=Zob9SFqcOff0SmatJ4sFzw3KzYqvosu3bk1bzXm5LixFDHY2/GAfai1LCE/xAMgKWr hrKRGExz7oV6lUmTK7myumG0IpnKqYeVRNj1CbQKS1fIWJ9OhXLEloSDl0aBsjV94vnc Mli0G4CyDq4tPtmv90PMoAmKGqQ0XQORSCE0iQsrLJA/xDT3gE+HW1F/0lGp5GxKr+Pl 7vUmPSCEIVol+bpoVUQ6aJQmDrNBoD6CR8+5b60hdiFyb8wh8Jo+QWgqVWy9LA9Sr1tK jaSquPB6MBifxpseuT5ofBUM0hmA7LPm6ClYDfB1RiloWJLHxeaMzcOM09IKDdGTWSG+ lTyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=o6GadWL9FpMiVRJIsdolf94ub9c2wj+B0srEPRRHi/8=; fh=pKnPKUsir0uEGSsor+4Zc2vgbu+g+ayvUgsdzkuXaoA=; b=dO86+lyhLz32LlsHPM570MV71T+q7/mSl3U5TTsHKB60ptO8hj+o3Qco8a/4ztKa/2 G9ynT3EXZnF3iO7GuOM/Ul7jPRc8edH1dlJ1+LaGrSFwnVebUKyfiE0v9xDnPdfaqQX2 +doREQdvPP5AtDq3pTAk6twHu0ENzVaBOqfRxWwix32gmS5rgpvy0JMwMek6aVBDGYL4 cNj61Zbhz5ID2zlEJ6fyOJim68nOryPElc9c7XWfkUcAcNdSJQsyKUcYTpEudEv8EpSE l4FPMqJPVwanxuSolYiaeFNzNar9TvrFZsp3BvqgL78m/OOTpG+JhtZRQ4AX26b84F3C LunA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=LGaXj0BB; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=hRgTolrg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id s29-20020a63925d000000b005775302b11csi1465516pgn.81.2023.10.18.08.51.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 08:51:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=LGaXj0BB; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=hRgTolrg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 3BB5F81E1416; Wed, 18 Oct 2023 08:51:17 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232129AbjJRPvI (ORCPT + 99 others); Wed, 18 Oct 2023 11:51:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41706 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232182AbjJRPvG (ORCPT ); Wed, 18 Oct 2023 11:51:06 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 28E2D121 for ; Wed, 18 Oct 2023 08:51:05 -0700 (PDT) From: John Ogness DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1697644262; 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: in-reply-to:in-reply-to:references:references; bh=o6GadWL9FpMiVRJIsdolf94ub9c2wj+B0srEPRRHi/8=; b=LGaXj0BB6V/RCSUd2bikdxO1ThAn5INzm6drb7NirEggUR9/WzkF5qAoAo/4hn/ELwSGOQ l8KcdpjIS4OOmL8hxbN5Hf8KTI9xNAXnBsBv1PML0IiCGCzOQslGRMqAq+drLfhABKJn4M CSMznIaODqO8nMXeRY00UVhu3q3UBenYB19rSrq+1J8XTCSQa1e4FqFFbvALunoYqeZXJh zbr4yvg6euB+BARJNxPj1licM7kjyhcTJG7lDN58awkAAZ0RCTKXFiaMMQ2obIMwaVVfNi 9xllQIyZhSYrIRNsRYv+9zhefXfu2w3HPVD/DSUw4d/ueZbRwxrFEvf3YWvmAA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1697644262; 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: in-reply-to:in-reply-to:references:references; bh=o6GadWL9FpMiVRJIsdolf94ub9c2wj+B0srEPRRHi/8=; b=hRgTolrgzoZRwPTSQi9Ycwg/Kgx6hn4v48bDX2jrhY2VixFgSwBNWJx9mhuyrS5Cs8MJsS TOZNjCbA+xqMolDQ== To: Petr Mladek Cc: Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner , linux-kernel@vger.kernel.org Subject: Re: [PATCH printk v2 3/4] printk: Skip unfinalized records in panic In-Reply-To: References: <20231013204340.1112036-1-john.ogness@linutronix.de> <20231013204340.1112036-4-john.ogness@linutronix.de> <87mswh6iwq.fsf@jogness.linutronix.de> <874jio6o2y.fsf@jogness.linutronix.de> Date: Wed, 18 Oct 2023 17:56:52 +0206 Message-ID: <87zg0g53qb.fsf@jogness.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INVALID_DATE_TZ_ABSURD, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Wed, 18 Oct 2023 08:51:17 -0700 (PDT) On 2023-10-18, Petr Mladek wrote: > So it is the _last_ finalized id from the timing POV. If there are > more CPUs storing and finalizing the messages in parallel then > it might change forth and back. There might be earlier non-finalized > records and newer finalized ones. > > It means that prb_next_seq() really is the best effort and > the description is not valid: Well, the description was valid until prb_next_seq() was optimized and converted to best-effort with: commit f244b4dc53e5 ("printk: ringbuffer: Improve prb_next_seq() performance") > It would be great to document these subtle details especially when > we are going to depend on them. Going through the various call sites of prb_next_seq(), I would argue that the above optimization introduced some bugs. I will investigate if prb_next_seq() can be fixed to match its description because the current users already depend on that. WRT to this series, I have put together an alternative implementation that does not use prb_next_seq(). John