Received: by 2002:a05:7412:2a8a:b0:fc:a2b0:25d7 with SMTP id u10csp312011rdh; Wed, 7 Feb 2024 05:42:15 -0800 (PST) X-Google-Smtp-Source: AGHT+IFvXJum6jfr7JF6/Ou/ulQs+kd8AybUhv0PyBZQmoEQAZTbaLTz+yPHkRv/bdGKPOaHw4s/ X-Received: by 2002:a92:cd0f:0:b0:363:c94f:737c with SMTP id z15-20020a92cd0f000000b00363c94f737cmr5662410iln.18.1707313334987; Wed, 07 Feb 2024 05:42:14 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707313334; cv=pass; d=google.com; s=arc-20160816; b=WkewEQLKyl9eMmZqJe3K2jfCbVvDjmuUtiO572Hf6LZq6bmOjjdQyEC/G76txnPW7s ocHHTktpW2elYKpCNuqywypJsl9Ft6KWEXieQkhMXEEdqCzd8UliVgoOrCGZbj5BBzVq 5QChN0UxJa7UgW6WA2Htdxim30TgigxVwOQSqBzTMJpIc7OzAWryKQSWuKBg+C00pUNd /gyt+dQ2pxrRDMyQgUbMGP9UelHP+N2PLA8CCPyi7RpacXNHCVAUmJ0OSZ+gjkt8vVTT Zax54zd1dYoNZpff9AeTBAQG87LKqq39KEN9zbJq31v+oMAwIJVStwtv3XQd3XHNxadz qbHA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:dkim-signature:dkim-signature:from; bh=krH2QkxdJALvXRu9Bq+Fw3gs7PqsPIKkUheQqZKkVK0=; fh=FDtoaB2gmH4nJCg7DC9LZSjjqpVS0jObH+xEUpkxDME=; b=jovFg9y8jQeNhe9SxhfDvzE+8QlFYKkAwGN0R/WdYt1kfWBtuGg+3bpN00144kgVg/ kskEpbnY7eNFcQKz1qSrF8axbIK3q2dUZQm10xRg0U5Rx3Elahw66VWgj1ZhS30Ah7Up MMgVAtrKfXZuIhJ3hxju+pb2TDMdc3QTf1Qn4skbA3FSIfIN4egvI/zVrE2wvDD4Pv+n 4fIjiGmYMZoxMUUW5fTIHXrNYSOI2jEz8+IatnWME2E9VQvD9Su6MNXeCqpKUTc1+cSc WJdkUSi4Y1Z17vWOfa/n2j+MjXCPf9xb5UfGv2h+rjAgNmAFVaYE5VrQKPOzGaXmZ5Yn 5KaA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=WRiRArBf; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-56566-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-56566-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de X-Forwarded-Encrypted: i=2; AJvYcCWcc4nhyDWXAD3QW39DNnc/cJ2empG3Y4SDhsV1/r2Zdl47ycP0UEyJe98tNkvbZ8m0C7vMXEetOFUbS7RZnOip9IlaORb151jKC8kfcg== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id l6-20020a632506000000b005d747b7058fsi1430871pgl.778.2024.02.07.05.42.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Feb 2024 05:42:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-56566-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=WRiRArBf; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-56566-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-56566-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 68B20283C3F for ; Wed, 7 Feb 2024 13:42:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 41B3D7E56B; Wed, 7 Feb 2024 13:41:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="WRiRArBf"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="rQSEKUb6" Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AF0065A118 for ; Wed, 7 Feb 2024 13:41:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707313281; cv=none; b=nx1GgXbXrRAcGJ4HNYLK6q/kM6ue6BB2drtXgTzGAOq+O23xGXh2SrSEOKdUMlc33/GAPRGVN1+s7kvlXkM+0xFQNoxw1EgncKrZxJKv2jUM3TJOSDP/WLVL6/aLt4h9PCmqxrL1LaCLtrpZujF5Vw/NmAB1PKzR51CzbRxc7CE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707313281; c=relaxed/simple; bh=vJqxW1p5ntcV7Q8gHg+dKNeHrRgOFCslGbsANTaGJrE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=SN0pI/PIuaQZW7hD+h4+xjmhS8tzAW/fuA2UVi75SGmgF+bv01DIpYmfqVrSUq/Thu40RBh/j9Ii/e2grr69prwq3JNFR4zRZeDuRkge3Y/eUBNh3fyPxYDw0DYgMWQhRfJ7BUmc0MbvusFx/ktLbvu4IF4rfqNR/6Mmx4+br1Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=WRiRArBf; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=rQSEKUb6; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de From: John Ogness DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1707313275; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=krH2QkxdJALvXRu9Bq+Fw3gs7PqsPIKkUheQqZKkVK0=; b=WRiRArBfTTPvencS3aNMh6U5Jll4BkBh3TxSXBL1CoGcfofnV9slVz9bHirftVZ+t5pBg4 EzczG4kxp49nz9+pUSB4YoXGZTnDRuG6ME5AcfuTctIYW4mDScQitWszFD8lECQe2H7WoU nGfzxZUpCCqfHaDeBxsbe+QZq+adxDbr6xjQlnoZ6qFQuiKmigH3jZLfkFgD5ZvuefAKm1 wzW2N8S4c/1K0gcv5fcVI7Puhg+2fsKyx/UnTuOoozrgOJ8eqKb8GeeC4GrkUEbuqBHWOQ V5ASb+cBWeAX8yEibld4K2JztthP83EiGMLCwkkbA1qdo9OtMD3Vu6TO3gDMog== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1707313275; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=krH2QkxdJALvXRu9Bq+Fw3gs7PqsPIKkUheQqZKkVK0=; b=rQSEKUb6LAdrLfbf/3uTISwSZSFmtlWYYHbFqF+X6t3mynIvhmFajaM7vSkWMB6D6NzSZj yM0rb7CMTdLBeWDQ== To: Petr Mladek Cc: Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner , linux-kernel@vger.kernel.org Subject: [PATCH printk v4 06/14] printk: For @suppress_panic_printk check for other CPU in panic Date: Wed, 7 Feb 2024 14:46:55 +0106 Message-Id: <20240207134103.1357162-7-john.ogness@linutronix.de> In-Reply-To: <20240207134103.1357162-1-john.ogness@linutronix.de> References: <20240207134103.1357162-1-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-Transfer-Encoding: 8bit Currently @suppress_panic_printk is checked along with non-matching @panic_cpu and current CPU. This works because @suppress_panic_printk is only set when panic_in_progress() is true. Rather than relying on the @suppress_panic_printk semantics, use the concise helper function other_cpu_in_progress(). The helper function exists to avoid open coding such tests. Signed-off-by: John Ogness Reviewed-by: Petr Mladek --- kernel/printk/printk.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c index be95a6851164..22bb45d8f2f2 100644 --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c @@ -2270,8 +2270,7 @@ asmlinkage int vprintk_emit(int facility, int level, if (unlikely(suppress_printk)) return 0; - if (unlikely(suppress_panic_printk) && - atomic_read(&panic_cpu) != raw_smp_processor_id()) + if (unlikely(suppress_panic_printk) && other_cpu_in_panic()) return 0; if (level == LOGLEVEL_SCHED) { -- 2.39.2