Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp248866rdb; Thu, 19 Oct 2023 03:30:46 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEEvCMvey1AakTx7dO0/F+Z/WlEHiideCvRJU52ymWI42TSto+tp/SZ7Cc2BbT+KMY6NuVX X-Received: by 2002:a05:6870:390f:b0:1d5:21cd:7069 with SMTP id b15-20020a056870390f00b001d521cd7069mr1860712oap.8.1697711446422; Thu, 19 Oct 2023 03:30:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697711446; cv=none; d=google.com; s=arc-20160816; b=UOTQZcbuoC6O8Eti5okQbXUxZqatjPVskNE3OSRMhTh86p5qioNfLpmNgnrsY/EHt+ m6+HJ6XtyPCZeU/j+0jVQyZIh0wf6ESyR+lI7riIPEDnf9akfYPpAJkeruwV505VKicc aWyKgURRdDUZlo4A0x9bSR53EvmZ1M44/WS3bvDIjeI/2P/9WO5+yVc8KgZp+SCBWU0f 9xNBmelxVpKeGDkax1c9r2UhR81NMHyJYOCIzFYTB+n6v7YSxmKlpVcP1irEENDo38Qw DMd9oBKP9r3y6apBBhbfJHJoVMKg2JGU/tbQ4fhrbxyYB7XZZWO659sH123Om3BO04LN WMYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=TLgvP92yemJZ35xIRDEDAp7w8W2m9wwRLyhhOh+AzzI=; fh=3oUSWWYQ0rMHaNqDlm8j09K7pkfJE062n+5jIRWafQ4=; b=z/aNqQGrz9gspci3xEZazcyxn5SNrHTK/ks4MEbCfRB5pnCQFSSoWMhVsc86/JT4Hc VNu+62GnaKEKlytepkRStlS4SlO6mgZ2s3eC9rckApvWdyrJgXKPrKexTzUUjSamfXgv 3pijPrkd2xlLTPB2FdahMjD2uM2/ihZH2Hc1vQoD1/4livqPIlxrLAC3QvhFoFfDdQdB Sc/PTdAu8KJncGDcYa1M18JDM35TjHCEk25HNFPLMduY9nlsO2NEXC8Y0D5CDT+Q8b4K Z2UiQFvMd3aJB/A8Ye4gyS0c1Pg46kkiktLZoHaKYwCBR4HmmgBVNvf/AMfbdkMZYWVq agWg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id n1-20020a632701000000b005859e224624si4091615pgn.823.2023.10.19.03.30.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 03:30:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 67DE78053675; Thu, 19 Oct 2023 03:30:24 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345255AbjJSK35 (ORCPT + 99 others); Thu, 19 Oct 2023 06:29:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50748 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345206AbjJSK3y (ORCPT ); Thu, 19 Oct 2023 06:29:54 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F182119 for ; Thu, 19 Oct 2023 03:29:51 -0700 (PDT) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id C6CBD21AC1; Thu, 19 Oct 2023 10:29:49 +0000 (UTC) Received: from suse.cz (pmladek.tcp.ovpn2.prg.suse.de [10.100.208.146]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 652832C4F5; Thu, 19 Oct 2023 10:29:49 +0000 (UTC) Date: Thu, 19 Oct 2023 12:29:49 +0200 From: Petr Mladek To: John Ogness 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 Message-ID: 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> <87zg0g53qb.fsf@jogness.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87zg0g53qb.fsf@jogness.linutronix.de> X-Spam-Level: Authentication-Results: smtp-out1.suse.de; none X-Rspamd-Server: rspamd2 X-Spamd-Result: default: False [-4.00 / 50.00]; REPLY(-4.00)[] X-Spam-Score: -4.00 X-Rspamd-Queue-Id: C6CBD21AC1 X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, 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 lipwig.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 (lipwig.vger.email [0.0.0.0]); Thu, 19 Oct 2023 03:30:24 -0700 (PDT) On Wed 2023-10-18 17:56:52, John Ogness wrote: > 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. I thought about caching the last seq returned by prb_next_seq() instead of caching the last finalized record. Also I thought about the highest sequence number accessed by _prb_read_valid(). But it can be done lockless way only on 64-bit systems. Well, it might be good enough. I doubt that there are big 32-bit systems. > WRT to this series, I have put together an alternative implementation > that does not use prb_next_seq(). Great. Best Regards, Petr