From nobody Wed Dec 31 08:46:23 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C00F7C4332F for ; Mon, 6 Nov 2023 21:07:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233148AbjKFVHs (ORCPT ); Mon, 6 Nov 2023 16:07:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57710 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233080AbjKFVHi (ORCPT ); Mon, 6 Nov 2023 16:07:38 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0FBB7D76 for ; Mon, 6 Nov 2023 13:07:35 -0800 (PST) From: John Ogness DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1699304854; 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=QMdwCTBCqjbEWs3BE4hUb1Y9Hym3aJ4RR2/J7tmD2m4kRWoI3l0B2B2psbP22JClESL9J7 ZgTv1JSFlm1LMLVKTaFpw7IaDmsVLLf+0+uSwWIoOPLJJXsxF7EQhdtPbqLKfbedcoSYOK oHLZo/QR8v6WlnUWfFhhUVBD8elhrD+EvlaYd84rX8j0QT+FjLqTl1eClLY2I6+tVxji0L 4NQ7PndmDJtqPTPCPnCe7RdXMERG5rqkuhtN6rNzxXPsr2mvRbMxQ5cDtAdiyWDs0DE2e2 yWxsRwU8mUaCACmX/UKN1m+uk8AwUbGpAK220XDYe7nr8JyAO6G6a2g9XpTAAQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1699304854; 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=mlP0P/xItlPB8rJI+B2aSLZNJdPxPRLp0Ee10WmEDPUHH+5vxuKYEC22SmOHkCwAKvaP7M JLdzZZH1TEVxRECw== To: Petr Mladek Cc: Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner , linux-kernel@vger.kernel.org Subject: [PATCH printk v2 3/9] printk: For @suppress_panic_printk check for other CPU in panic Date: Mon, 6 Nov 2023 22:13:24 +0106 Message-Id: <20231106210730.115192-4-john.ogness@linutronix.de> In-Reply-To: <20231106210730.115192-1-john.ogness@linutronix.de> References: <20231106210730.115192-1-john.ogness@linutronix.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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; =20 - if (unlikely(suppress_panic_printk) && - atomic_read(&panic_cpu) !=3D raw_smp_processor_id()) + if (unlikely(suppress_panic_printk) && other_cpu_in_panic()) return 0; =20 if (level =3D=3D LOGLEVEL_SCHED) { --=20 2.39.2