Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp786lqz; Fri, 29 Mar 2024 06:52:58 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVZxubIyqWuOj0xyjxMyNcm6TemH/sGRp8WyQG+shH5l15Weow4wJRC9GvK5d0baTGfRK8lX200foIVKUS3409PXRDaLJfcfgrcauLi1w== X-Google-Smtp-Source: AGHT+IEEZsRMcSjS6MfOIAKTlSnd4svmfFQmugSkuY/TzNOFjtMFVFX5ZoV8UYQu2zBEeadMbMgh X-Received: by 2002:a05:6a20:12ca:b0:1a5:6c53:b1f4 with SMTP id v10-20020a056a2012ca00b001a56c53b1f4mr2318072pzg.39.1711720377581; Fri, 29 Mar 2024 06:52:57 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711720377; cv=pass; d=google.com; s=arc-20160816; b=H3W/VTJx6Eit+RGWGb/6lz67NUKTurROr/A6ywyOFOjXE/ynNaTVlK3nDXVAVhqtwR gRmnOMZ8EdMS0xw8L8WfH9iGUZ6wPTVLOlpxa9jPSjdTcxYLdWYZH0DO3xzfQJeKSSpP iSlXFyYEte3deZqdL9FZVzvdCYvaiijVAgF+6ArQ1dL1nJpFOaFgRLURKq+h8uXGwGn3 qXXNe0p9bEZcpt7FuznowV8S9D9xE4W4cHXszk+9z58LWr8zNk75RmZme9OAr6d9Ixqz NnT3uq/0xscUfmDEErw+CMMj1iTV2bR8u/Zh1dg26V++aSy0NbcEaQbPs1uarVwrlcHA p+CA== 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:from:dkim-signature; bh=DNdp+SUI4aGjblGnImuOaY471upI1+K7mTgTJXnm6nM=; fh=j+aMbK7eLMI2KMaRmGMOCTxfEkIc4TPOnxEcnsSirNc=; b=vsLLXRYNy28dMv+0IyxXlk7e0zXkc0dYJA4bhnTjeCMw2UPcCql6tdi9BxRJkEU6GV 8G0GsxXlJFhoVmHaebXplS69Pl+NVbFnyLdBRFfFfEbxI0ag6JEwT/3SqUOtY45+cyvC 3YLLW9RKWoAifTjlhKdqm7/O95SI7tak/Oa/KRRIXeGBpYvA2bLrVvbxsI7cq2mCbl4e izZ76tOOJh0L02C5t0rYlXdfDSbtXcPxFkbUBwVfhLanZAoqVmSluntuyCprUiS6O3Zw sRe4K9F6r8UwW/LCgls8S7V2oOpDL+dKchng8SRc8HLPtft8KY71QuVFKLd2ymcUFEtC /lOw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RulDcYR4; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-124728-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-124728-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id v1-20020a170903238100b001dd46c442e4si3704732plh.270.2024.03.29.06.52.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Mar 2024 06:52:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-124728-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RulDcYR4; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-124728-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-124728-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 11198B21674 for ; Fri, 29 Mar 2024 13:35:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D364A17823A; Fri, 29 Mar 2024 12:40:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="RulDcYR4" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 C8F14178221; Fri, 29 Mar 2024 12:40:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711716021; cv=none; b=k4wOTwI4kRIh8AoayOluuuwwaHN9bSTpOedVjG4tfD5gA4ccD1JfXIx6RgX3i5VbmIkTJ/TQKKRMZSzMaE238X+wvXfC1Q3dtsBcKyf7YgIQ1TZKtHXJjH/PL8dT0gKJj2FdVobLirQd6fSjpoOO3xaXknVc50cAwOQzRStyK0Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711716021; c=relaxed/simple; bh=clxWihJjspTTiqyEKqg1yvayyGIOfGSuJL9pp69ouIA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=h3UrH+dHNddJrHYM0AtkvSaBW5ArR8QyjeDs+TVwMfdRA7EKQL2k6ktDpKdAxPdLwmtawXHvoig4TE9g8ZVbcPeH2j0ed5iLvucHS1yw98AOiWX6c//5oNr0NX/1IPOhJKGNlgPhxn0q4ICEVx2AZOvex4R7OE49JKWGgp2qh+M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=RulDcYR4; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id BE0DBC433F1; Fri, 29 Mar 2024 12:40:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711716021; bh=clxWihJjspTTiqyEKqg1yvayyGIOfGSuJL9pp69ouIA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RulDcYR4PYxvCisoNsTeFWA/dnjd6YjHDBMI23hNP1NiPNnsEeGEZlkn/aejH3qzF 4f7Ohl7WcAmMeKR4KByGePTEuf2rw5Jvs34Z7r7PSlSGNISd3EhGQ/6hKdk9I3y3Dw Kwcv2tqSuE7cHgbv0aSIKcGUSbhwZfI5auoKILkkq+UtyR6B2RnxepNgKwG2RoXIK0 CEyJKemqEvD1pFgeoLqPjW5Qv43waF/T0gOdsfqme8shiotVJaS9WgoLZHi9SiqL2/ rlUDkeXzerG9JkQR2OpTpo7n+XrRrF1W07CEoWInDT2Ja+WOWumizr7zbtL8Kcss6T WnXXI2sOjft3w== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: John Ogness , Petr Mladek , Sasha Levin Subject: [PATCH AUTOSEL 6.8 19/98] printk: For @suppress_panic_printk check for other CPU in panic Date: Fri, 29 Mar 2024 08:36:50 -0400 Message-ID: <20240329123919.3087149-19-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240329123919.3087149-1-sashal@kernel.org> References: <20240329123919.3087149-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.8.2 Content-Transfer-Encoding: 8bit From: John Ogness [ Upstream commit 0ab7cdd00491b532591ef065be706301de7e448f ] 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 Link: https://lore.kernel.org/r/20240207134103.1357162-7-john.ogness@linutronix.de Signed-off-by: Petr Mladek Signed-off-by: Sasha Levin --- 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 f2444b581e16c..d9f20d222293b 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.43.0