Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp2401926rdf; Mon, 6 Nov 2023 13:07:58 -0800 (PST) X-Google-Smtp-Source: AGHT+IEqOJbbXdGH5NK346/mqpSLwYQtXb+vyW/GKSBy4+PazMe5XBSFdvNwQGHCsfqOIMcNWHtL X-Received: by 2002:a17:90a:2a4a:b0:27d:8d42:6def with SMTP id d10-20020a17090a2a4a00b0027d8d426defmr23609843pjg.34.1699304877784; Mon, 06 Nov 2023 13:07:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699304877; cv=none; d=google.com; s=arc-20160816; b=c6UYsPr6f29D3j+aMIqF9MJZAnPjtNdV0bQ7TxbEbUg1MD/vduY5zA8gBu4dC1vfsK 3ubhF4sVs2I2Bx+eJJn4VLOHAYEQfmo/tIT4wUOz/NKijvIU/4UGgSG/KB9/CswNtsAN ggWqLDpWCXrt/Sv/47EhPmF2ES6fHYvfyGkmXb66voVeWZ0xAfXIQci3x4JfH5Xvw/NV 8RAPUPJQ0TuZT6l7ZV65wjKJqLErPUYKaMtXtK8Ht7GNQLEgWtT2esModMIR+9X1kekn 3TNC0Co6c7LxX0kmJxw1Zv8ixhMLV4j0is2aG+z46niq9A0sdmlsY5c1Y9CugmXRQEHU ZnIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:dkim-signature :dkim-signature:from; bh=krH2QkxdJALvXRu9Bq+Fw3gs7PqsPIKkUheQqZKkVK0=; fh=pKnPKUsir0uEGSsor+4Zc2vgbu+g+ayvUgsdzkuXaoA=; b=Ek5wdszqUTTyQGlJ7dqtDsTvENaKxmO6zoQot0/92CQeUX11kpd3ZrQro8q7gL06Js WMP2g0/jGvltrKaM6dLSugnO+pgGKrHrQfMoOu6Vrj+PPZsuhj/gHnfQfVplaUw7tbbg GeSH4S+JYIuweBup/QJK88Zv7ZOfItp2iEbxwR5u/yKlpdrVQa1zJbt+5IMnz97eJgi2 XmveHvJW7uWLZwfEbuSLLKaqXjosGlASg9qaWfIEwN89ojec7KztqEfBmF4GEjFcvHtc eZqSzEO2R1HtntihHFxzh0CbMZqG9fr+kr0FNsa/LWeySEHTVkZNv/a7Yn6vcdPUdp0/ 8Haw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=QMdwCTBC; dkim=neutral (no key) header.i=@linutronix.de header.b="mlP0P/xI"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id a73-20020a63904c000000b005ac6d182454si520973pge.497.2023.11.06.13.07.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Nov 2023 13:07:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=QMdwCTBC; dkim=neutral (no key) header.i=@linutronix.de header.b="mlP0P/xI"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (Postfix) with ESMTP id B5C98801B3EE; Mon, 6 Nov 2023 13:07:56 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233142AbjKFVHr (ORCPT + 99 others); Mon, 6 Nov 2023 16:07:47 -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: 8bit X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,INVALID_DATE_TZ_ABSURD, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Mon, 06 Nov 2023 13:07:56 -0800 (PST) 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