Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp1208959rdg; Fri, 13 Oct 2023 13:44:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGQAun5CAzxaMhC2djCW5NAfTJ7PQUvOAA7QoI3wWX65/dWM8Qv57z6xVhZFhA+4UoONKTQ X-Received: by 2002:a05:6a00:180c:b0:690:d008:8cfc with SMTP id y12-20020a056a00180c00b00690d0088cfcmr32747857pfa.32.1697229843496; Fri, 13 Oct 2023 13:44:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697229843; cv=none; d=google.com; s=arc-20160816; b=AW8fn3UBAtUvmbDNcv4UKSBJs9TU0/TX63sGh3khtGLAXjH1moPXv34Ngis0CXtRVT B8wtAOIJOmS/QwCw1vquBh4pyyikQhHu3KnIznTLaZ3Gawu753wL9pGbRJen99NhbvaN w8g3lVNy/kYxEo7ZzZJiMM86BGypd8WeWMtx5B17lxJTMOs/Kuhvj9m/gnKflfqnujww RQ5fjURTLoF/nz129IAdC+1SLJa7+NPfhWrJxmP9LetFCxJ93bW95ehdDdJzcPRq/T2d UtgMhP0OYvptMi2DEErR5IpkKo1SC6zY7DeaCJF4raOfBqObHrjo+kUcaQaXnQwIYK5a VlUw== 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=wWIIv+mLjlrT3V2Ul9kxF8dv9mzOp3dRSypIrr6l33g=; fh=pKnPKUsir0uEGSsor+4Zc2vgbu+g+ayvUgsdzkuXaoA=; b=Oj90WTE+9cP5EKf1O8EGI4TuQJLlIvh5TRHTghbtFfDmS47xSIUSZLqohM7znlRmH1 MeKx4rlcVZN35k9kVGog8e5kmBVtK9EN6GdPwtS3hSlFTZyKJ0qhvdLheQKG9li0a97f JmqNbf3xU5AP/UG2jNvdEwUqk8UdCenfLm/QzoDTYtPeQymLiX1JPJJrt48NT8azMY94 kx2mL102D4l/FQnQnmLCJIsGSybL+ogHFc9BPu+T9RoHeazJbtg2OUaFnEESHGbr+83U yBUxsTdCH6PaY/fDgAcpBNrmSNFTmQ+3XGp9F8Z2NlLgChjCACmC+Wyh13t23W6cAc03 QitQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="iQ9j/OaO"; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=XY1qhTh8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id bv7-20020a056a00414700b00690c75e54e1si14169616pfb.402.2023.10.13.13.44.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 13:44:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="iQ9j/OaO"; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=XY1qhTh8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (Postfix) with ESMTP id 2E5E38348DA7; Fri, 13 Oct 2023 13:44:00 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231788AbjJMUnv (ORCPT + 99 others); Fri, 13 Oct 2023 16:43:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44350 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229632AbjJMUns (ORCPT ); Fri, 13 Oct 2023 16:43:48 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F27CB7 for ; Fri, 13 Oct 2023 13:43:47 -0700 (PDT) From: John Ogness DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1697229826; 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=wWIIv+mLjlrT3V2Ul9kxF8dv9mzOp3dRSypIrr6l33g=; b=iQ9j/OaO0KmRmMgeb3zvonpmkyX4c5ltMPzzabjnEv9LTH/KM0QA/3FCN0HC2sEOYEczlk dDEeZAht2XukYEi2tuCNweaYqJ/CDzmOTDqW3c6AKtg8jsLkfYyAWmBs9GaR+8e3pFNBpr 9k80QK/8KqpEMxcge+27crw/oBWDh2aw0+pEIY65FLYPz+v8M1Y/D66qmR46egXRRV9KGe NAU13R6AZcjdYaKy9ESM8N2bT1uulWXGJkYtwR2FPftHjrXHmPHsh2liL3AkL1gq9k3uK3 8yIA0bTXL30BGh8qV8zx5QpI76nfTi0Rk/u4nkG/sez+mpfc6SqT4GI8ekxEYA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1697229826; 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=wWIIv+mLjlrT3V2Ul9kxF8dv9mzOp3dRSypIrr6l33g=; b=XY1qhTh8fG/ononxo4SHAtdSqaxOydbsd2QVPEdbzEnvTF5wBVq1jJ2ulbRVTT2/GzIoUU bCfKAVtH5BYIrpBg== To: Petr Mladek Cc: Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner , linux-kernel@vger.kernel.org Subject: [PATCH printk v2 1/4] printk: For @suppress_panic_printk check other panic Date: Fri, 13 Oct 2023 22:49:37 +0206 Message-Id: <20231013204340.1112036-2-john.ogness@linutronix.de> In-Reply-To: <20231013204340.1112036-1-john.ogness@linutronix.de> References: <20231013204340.1112036-1-john.ogness@linutronix.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INVALID_DATE_TZ_ABSURD, 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 howler.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 (howler.vger.email [0.0.0.0]); Fri, 13 Oct 2023 13:44:00 -0700 (PDT) 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 --- 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 80eb79177bab..abb6a50ee26f 100644 --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c @@ -2272,8 +2272,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