Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp329564rdb; Thu, 1 Feb 2024 09:35:55 -0800 (PST) X-Google-Smtp-Source: AGHT+IGjF9CNubFF5uwZozeMZb9xzfvjWjf/oNpckZtzd7O7wYxJGS140rJbhpS1kYWTmL3tBkbh X-Received: by 2002:a05:6a00:391b:b0:6dd:8738:2c8d with SMTP id fh27-20020a056a00391b00b006dd87382c8dmr7010403pfb.26.1706808954812; Thu, 01 Feb 2024 09:35:54 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706808954; cv=pass; d=google.com; s=arc-20160816; b=qkD+IJiD0ivcjGTyraQ9Tvjsnw9e8S6vwhPFOszmoin8wmx+lGhcqD9v1Up3aWTS+6 1LiKWd7vWhggeCmbXZcQyJC8/I+vB+/8zGMwwE1a0QFMIbwmcwuBoAtcp6ADCh3kO87a uOf5CL40baTXmGcHh9xJl+lcFcbeu6D9QJf8H/vH5hgQfmGmBNL6R9FcJVHg2WFNRHTA dcZHB7BE7Ws8LMm01OEWILTCRSU4a3ric5ccMc+N/Joy8JJmr0ylDb/jg3LF7bPqxn0j yVU43/n6gDYrCsi65v/UqanaWKYCTJDN2tFXDnOxCmW800habkcuFOdQ2sCLgHg2Y7Mr aeqg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=r2zWO0smLAGmtvPb3ivEDnsJI2xQS1BwMneE9ALhqNA=; fh=5DWJRLIsh1PP6cz4eHIIIq1DGkX73TkmcJaVY6IPrsI=; b=sT43AI6ZGLdPP6DLnrnvhjsX1+4iCwERbBuQnwjuV+pq2CuFH4XFMg5e4vowuFni0O 4McOIa5XohCWQtATdLdkQgQa3+IVmnR8fPgFKik/oFQyueqG5N2ISuMM1CGFtPLazV4O eXHilZxy/N7pOfqPZ+liS1ZRm+9T0zMKpMXx9gJiws6uahCHYGKNkIOVsCyEjr9IId2/ jqQsUI0e44YSL6CEXI3RWpp0kv6Az8C32BcToIz6om9LDooVZqiqmtKS8cjxNJwyLPQy e0OiFXnh4/ytVQG91LPuh4YGh/UsLKHKy0V9icWGRLvLXzP8qYBWRZNT4Rp2WHo8RNGe fiVA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.com header.s=google header.b=CN+THqdt; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel+bounces-48560-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-48560-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com X-Forwarded-Encrypted: i=1; AJvYcCXy5XTi7IO2VUTmf7g2AMJJZaWJFYSrct6WFp+THXoqvh3Hx8ho/MJ2e4yLAzmIt0VNoFYsNRwo9L2+xbNTQw5Z+xCCbbHGLSpVk0TV7g== Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id d3-20020aa78143000000b006dde4453540si1596pfn.258.2024.02.01.09.35.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Feb 2024 09:35:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-48560-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=google header.b=CN+THqdt; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel+bounces-48560-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-48560-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 3C747B32735 for ; Thu, 1 Feb 2024 16:57:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9382B1BC52; Thu, 1 Feb 2024 16:56:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="CN+THqdt" Received: from mail-ed1-f44.google.com (mail-ed1-f44.google.com [209.85.208.44]) (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 3BC4053AB for ; Thu, 1 Feb 2024 16:56:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706806618; cv=none; b=YeQOCkE5LfGM33Xur37DPFKGnl+S3Eq5SdWA/txjMmxa1VZpcQ/sipZMa+TSe79lQYE/1XT5Nts232eJTB9x0Aw8hrDHcgFRTvr42S+CS7Rrbaun9CBH4wDvK53gedv3BWRI+kCPPStbJVSN3n65KNHF6KqDG3+II7eNn+W9LUU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706806618; c=relaxed/simple; bh=1TyGcUJteUe3Ay1dqqyUUF9jwFYj9b1XBMtLo4KWxoY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=KSCrYJBgvEMkbz7kvp5IQ6TvjFUa52LyXh49m7K2e73RqG3qkXq5NN1w0fhvBX8szuF1Kd3OdCJ920yBeCX3L5zD4XcuRhok50MgeDiCjbcP1vuqmHTnZtZ1vtIHoNQxqqYEjutU0b01YA7tgNu4bqKL7ycHorpiMJPbjwt/ueM= 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=CN+THqdt; arc=none smtp.client-ip=209.85.208.44 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 Received: by mail-ed1-f44.google.com with SMTP id 4fb4d7f45d1cf-55f0367b15fso1545825a12.0 for ; Thu, 01 Feb 2024 08:56:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1706806613; x=1707411413; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=r2zWO0smLAGmtvPb3ivEDnsJI2xQS1BwMneE9ALhqNA=; b=CN+THqdtgGdQOfM5E/5wk1o81nBvU8QwEvjH46WTrXjDN5IYOanck3YQecAdYzUyOJ hwdgf+2D416R58Oz5I48DUi9WXN08g44cYvbs1N5OncKJecozqki5JEUWgwGP1ZSnzGD /+mS2z5T/euPt9USxloBjpG7m/e3twwPhdhbQ7PqSKMjbBFn5K1/l00i3WRU3z6jMkuj K1PORfGo4RDOurfuiOqsW20jM/Y8LZ1LVHdiGHjHllDYkC70b86Owxgqo0Amd9pQbLuW 76zYyQjg3y6tgTqY8DjpcC4fspCRC9E7xO8NUVOMOs4znHaTaFd683AIUiVrbWZA2ahZ /How== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706806613; x=1707411413; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=r2zWO0smLAGmtvPb3ivEDnsJI2xQS1BwMneE9ALhqNA=; b=iSmc8YKb846KF1/3nkzi/UFhLh0+c/gWBO50IYuTO2y12msWFzDZzLGgnAh5LilQMv iEnFew7nT74zvjWzeKrGAX8gMaqJyLchRniuM4wxr1RebSPYAc0uJYbvW2T5eFYvJGFo 2ZsLdQTGf7qeMcg0xHb1pafWFkWz4HzQkxPi2dYS5tIJ4h2tXBVZnfgN2mrrSj8jQKmR QZeSK52kf0CgD9s/w5Ce2ODfdJZEU2swL8WvGwIIzOD1MTNO9l4a1HwxvcbaXMRzioN9 Fw0Q4pAgkhHOE/Q/QoiiZ6ec/u+iMEjo7qFvb378TLwezUNFNJ8p+0UX+xLIbkMl0aa+ wikg== X-Gm-Message-State: AOJu0YxPz5Rnq7iPxO3dKl2I9Kcgdnm3Mgd1oKA+ZgUZzrO/T0IC1QRV uvH244/UoAPYzPS1fNWxKCmgLaZCk6tdd0+AQoPurnKdObnZdSVK5HbXww+zEGU= X-Received: by 2002:aa7:c353:0:b0:55f:41b8:7a2d with SMTP id j19-20020aa7c353000000b0055f41b87a2dmr3639683edr.32.1706806613356; Thu, 01 Feb 2024 08:56:53 -0800 (PST) X-Forwarded-Encrypted: i=0; AJvYcCWRyF/K4rE+1A+WEDZO9x9IqgaiXJHFX12WjuDps+gjNm6/LZVl2OGcWxVmQDZQxmdzDeyO1t+OPR6Ux0sTjbB0oQiCDRv3ikQfSWPwn3/3hV38bU/2qAQANfz5dkg/TkWLfWOJoTM1hF4VhTiUDSo7RpJz7UY= Received: from alley ([176.114.240.50]) by smtp.gmail.com with ESMTPSA id i26-20020aa7c9da000000b005581573e251sm6980810edt.2.2024.02.01.08.56.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Feb 2024 08:56:53 -0800 (PST) Date: Thu, 1 Feb 2024 17:56:51 +0100 From: Petr Mladek To: John Ogness Cc: Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner , linux-kernel@vger.kernel.org Subject: Re: [PATCH printk v3 10/14] printk: ringbuffer: Skip non-finalized records in panic Message-ID: References: <20231214214201.499426-1-john.ogness@linutronix.de> <20231214214201.499426-11-john.ogness@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=us-ascii Content-Disposition: inline In-Reply-To: <20231214214201.499426-11-john.ogness@linutronix.de> On Thu 2023-12-14 22:47:57, John Ogness wrote: > Normally a reader will stop once reaching a non-finalized > record. However, when a panic happens, writers from other CPUs > (or an interrupted context on the panic CPU) may have been > writing a record and were unable to finalize it. The panic CPU > will reserve/commit/finalize its panic records, but these will > be located after the non-finalized records. This results in > panic() not flushing the panic messages. > > Extend _prb_read_valid() to skip over non-finalized records if > on the panic CPU. > > Fixes: 896fbe20b4e2 ("printk: use the lockless ringbuffer") > Signed-off-by: John Ogness Makes sense. The most interesting information from other CPUs are backtraces. But they should be finalized before reaching panic(). trigger_all_cpu_backtrace() waits until all CPUs print the backtrace. In fact, it might be even useful because other CPUs might just spam the ring buffer with mess caused by the panic() situation. Messages which caused the panic() situation should be in the ring buffer before panic() gets called. Reviewed-by: Petr Mladek Best Regards, Petr