Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp6284754rdb; Thu, 14 Dec 2023 13:43:24 -0800 (PST) X-Google-Smtp-Source: AGHT+IE/0PGzxEjnYdDMoDOxWfNA+sa5EQOKKn8/Rk1Ng2+22LX0+Er2uxZj8vUaQ4JKDkGsum5r X-Received: by 2002:ac2:498e:0:b0:50b:e476:4b82 with SMTP id f14-20020ac2498e000000b0050be4764b82mr5408897lfl.55.1702590203952; Thu, 14 Dec 2023 13:43:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702590203; cv=none; d=google.com; s=arc-20160816; b=S+4nFPpqpcA9UJ2aWxVzPzGhpKfLeoPe3UpvXtAGs+wekA8yN00/xD5GVHAC6adNsQ oaojDrcUCH0jPtLjwfghO6wpB/7oX050WBZXbjfmFiKh7Vk86/XmdTo3Yz8291WhXzTK MVDd7TlQy6LudzZ3JjWs3lFH36dwCntIN2JnN0RabDfH2BDP5bAtPQiqcjoKAusAz4uG lSZtmdTtGlFn908aNuOZS/Hb2OABQQcYXqRoE26OPYelT6r0cFLrNdPTbrVpg54lVakO MIm2KYrWquSa9P55BLBYgQDJZEmevA1ZtBHSRB0AY9n/vsK9qoGOltPsQvFmcjgULvAJ q0zA== ARC-Message-Signature: i=1; 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=pKnPKUsir0uEGSsor+4Zc2vgbu+g+ayvUgsdzkuXaoA=; b=d89FF7WYMBsa1pZC2OdZciNwjpzkeS+Ac0h+gLqloUPwVzua9O8SWYFeGCwIDs47u7 bo6Gbop1M43Ynfcc2BNL14z3DPRBSfEk7u3htHD45m21+ZV8GElXhLL7jlA5ugvSVmL0 EIQxgTHYIur+7uL/hI7TLwbmitBUbcJAx3sPLj4l+TFOcfJaIW02fBsu76FzYqUdbeTw 9POqDLZksGqYu1akfbyI8ycWFWT5rgaa/VYs4vsViCrgYIfw1V78/r8VmlJ4bi8OGX/C 71b6f+jOKZHDyk2g7viFl7JnqPVROXIykNQa6aMLjl6tqEhqxNbiMpJbwWWgIFMXsWM3 567w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=qFYyVTuH; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel+bounces-149-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-149-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id dy22-20020a05640231f600b0054c878f57d8si6567492edb.660.2023.12.14.13.43.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 13:43:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-149-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=qFYyVTuH; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel+bounces-149-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-149-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 am.mirrors.kernel.org (Postfix) with ESMTPS id AC3061F22801 for ; Thu, 14 Dec 2023 21:43:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4B2126FCC1; Thu, 14 Dec 2023 21:42:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="qFYyVTuH"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="BsC4fnb9" X-Original-To: linux-kernel@vger.kernel.org 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 D9ED06E2BF for ; Thu, 14 Dec 2023 21:42:10 +0000 (UTC) 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=1702590126; 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=qFYyVTuHxgTC9QlqyN1QHK4WWfE+6QS+rbWzDp1kBMoZyEwL1jBrlUDxSBt83RF2jSKdlA 7yg9jBlzbenZo7mLyIr1X94I8l71A4kFMrVWwjuSQoVBE7UUdKn5C7q72xIHkRcsFipQ1p SUC0G6X64Ls7EHDGpIWHfWB2FOQ4Y+3YGhF9ezaXMQ0Oqy5tWZvSH7It2NZGDZ3mSbWHsA bGA5qd3r5PI28RTsZ/NPKam9jm18sp7LTL7YQtn8bR0womOuLsioiX3v5r8+F46kqNG0k9 DZYZqLCVOQzeq/o8a5LqDMlwuya6GYVe5l16p+R+mZSbncMtq82KHSTWy6JS4Q== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1702590126; 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=BsC4fnb9tj450t5e44z0HhzQgechD4kbG8CjJvyXCEcSe27WZN0mvwHswe3ax+IlcCw2RX yGM+a1ZEl7KBdfAA== To: Petr Mladek Cc: Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner , linux-kernel@vger.kernel.org Subject: [PATCH printk v3 06/14] printk: For @suppress_panic_printk check for other CPU in panic Date: Thu, 14 Dec 2023 22:47:53 +0106 Message-Id: <20231214214201.499426-7-john.ogness@linutronix.de> In-Reply-To: <20231214214201.499426-1-john.ogness@linutronix.de> References: <20231214214201.499426-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