Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp773224rdb; Sun, 18 Feb 2024 11:01:29 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUem1y/dPwivmBFsrv+SV6HuubB5K3SCtj0bidqetDMKmR/3frMaqqcGyM1kfOWgI1tLNbdrMNHji7v7jDoEkR7qunaBFkqIyam7FCK7A== X-Google-Smtp-Source: AGHT+IFu0XzZ7+BRIT9PLKB6a7Ws1v+8PjsM0nosTGlW6bkIOVlQjw9tDlr89GWS7dRSPH84uMPx X-Received: by 2002:a17:906:1d4d:b0:a3d:5ba3:1182 with SMTP id o13-20020a1709061d4d00b00a3d5ba31182mr6406683ejh.30.1708282889509; Sun, 18 Feb 2024 11:01:29 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708282889; cv=pass; d=google.com; s=arc-20160816; b=T2jf9VAqbiFuy0WVP5O1kwOELME0yxLdf/lZqhq+4rbgFPBsI4IHUx7PEah9bE1iXR SEQWMw8U00PcQCV0BDTlYA572gZdUqbpKtFCpiRiXnDW7wpFIgPHXm2zBP/1lRdfxZYP RWhmPMUXfrinY5JOIrV+ao1v6anAkXYdVDq0AG8EwAtwE2bU+mgZKf0trrAVPV735fko me6wL3XMNlDcvR0BHmf2K6YJVLgpW8aU7SbNHWkjZKn7dAZnToBoV5DS7U7P7HuyLN4F zq6akr8Zsm8S8naAW9lQ4axv6wR/BchRByM0G8LU5jRuW9QUsFTiZSFBp44GsUCa/506 LfgQ== 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:dkim-signature:dkim-signature:from; bh=0lPBki68mVE7PCw7W4jrgk0lCFhQvBUvfvhYmuWjIeY=; fh=baLZk4VyAx6eqLoRrdDbCsrkF3EpnrHuPZYH860mNkA=; b=s8QHATmrJvnyCDQQVyp/+LC6BOI86kiP5TJn0JyrcYAGKoyYtQus2/3MljfVR/1Ute BxA8h52/79wnefjoQiIzIUIMp1Kgg/qxHJPAXHUHPdyR4MyaixkMLx2hiZFW7u8qZV1O Kk8E9rMNF03Y6qTRXGHNAIMJtRR+b6H8CjROx7WKNpMO0lZj/mLU0efOnsxw49QggeO4 fAAdK5hIWnejyvBwQQuWDooGzUWehNFXoCoyXlbdAhvXSaFuNInGp9dgf+D/CYzhb5+H dtVhESDnT548KD0xvcunFGyVvlOaz2R15AQ3cOQ9auF0OolfsMB+wWK1l4K8D3+ogTSC oxeg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=16iOEDIe; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-70520-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-70520-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 n18-20020a170906089200b00a3d606aea95si1785781eje.223.2024.02.18.11.01.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Feb 2024 11:01:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-70520-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=16iOEDIe; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-70520-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-70520-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 46A3E1F20F5C for ; Sun, 18 Feb 2024 19:01:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6F062763F8; Sun, 18 Feb 2024 18:58:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="16iOEDIe"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="iHynVoQd" 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 1473B745D7 for ; Sun, 18 Feb 2024 18:57:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708282680; cv=none; b=WFMpaxFt1JabkoBdfexDfTXiArKZQHl59pkHzwhBZJuB96EYGwDNFgcJRLXgxZjsWiNLHP9+goifnC71nJegZ36nMjSO0tEaKIwbmOOprF6poOx5iUWHRU2pg6fMJGPil3hXZLwPB0EKKh09aqFsqARmjIpj+nV/qL6BrViKzbo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708282680; c=relaxed/simple; bh=OagJvzD8CITXGM05wrJdLFbnK8R3FnQZlKkDZ7ArXY0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=tl+0ejlRmOjX/bpbMvekIMokL61zLSwCbpniIimvTW1ZpBQOai65e4a3Gu35+4SJZLoJjEVOOAiG7OHIHvoV08BhGtJGsr/2hLL7DuC+4+qLZZ6xCMh6Qmjo9PvWk0tES2fUVRTeNtv9IwIUrmSrrgCnyZbjYtwk9SVWJ0OIwwg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=16iOEDIe; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=iHynVoQd; arc=none smtp.client-ip=193.142.43.55 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=1708282677; 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=0lPBki68mVE7PCw7W4jrgk0lCFhQvBUvfvhYmuWjIeY=; b=16iOEDIef9bfi8hm5YKwdXMo0KA3BGTQYHPoFj515WihwX2bbE+vwFUVFaE5Du1RD7Y5W2 RPwwTqoL6dA2GLDE1UyNa3DkBrV1y2AT9dUZM10gr2IQ6QTaEIKAOA9R1vYmwRH7v5i/LW hBXv3pVUwSCOxaDFMsCTnMSJrRE+ezEIBTczVi/gszaGneoixpcpGkWyW361N2KLds8b9E T1VuopLugS5WomPG7SWkvrlSVJ/kiI4l4ux3mRbLXZo7iqt/NUSd2lWWwWiVtaTjb6MluE tD99NTIR2S1ylI9Jywrwdx9LaxGtztzqu6YDkz54DL0f/6KRyFckh8LM/JeqyQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1708282677; 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=0lPBki68mVE7PCw7W4jrgk0lCFhQvBUvfvhYmuWjIeY=; b=iHynVoQdMqQvQ5UY9zDTHbYAg0fKIK48nfTCXAbx3zmnVvmiXaZF3CIrbiq4IENzpgm/Yp wGM0dChF7tn7OlDQ== To: Petr Mladek Cc: Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner , linux-kernel@vger.kernel.org, Peter Zijlstra , Ingo Molnar , Will Deacon , Waiman Long , Boqun Feng Subject: [PATCH printk v2 26/26] lockdep: Mark emergency section in lockdep splats Date: Sun, 18 Feb 2024 20:03:26 +0106 Message-Id: <20240218185726.1994771-27-john.ogness@linutronix.de> In-Reply-To: <20240218185726.1994771-1-john.ogness@linutronix.de> References: <20240218185726.1994771-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 Mark an emergency section within print_usage_bug(), where lockdep bugs are printed. In this section, the CPU will not perform console output for the printk() calls. Instead, a flushing of the console output is triggered when exiting the emergency section. Signed-off-by: John Ogness --- kernel/locking/lockdep.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c index e85b5ad3e206..00465373d358 100644 --- a/kernel/locking/lockdep.c +++ b/kernel/locking/lockdep.c @@ -56,6 +56,7 @@ #include #include #include +#include #include @@ -3970,6 +3971,8 @@ print_usage_bug(struct task_struct *curr, struct held_lock *this, if (!debug_locks_off() || debug_locks_silent) return; + nbcon_cpu_emergency_enter(); + pr_warn("\n"); pr_warn("================================\n"); pr_warn("WARNING: inconsistent lock state\n"); @@ -3998,6 +4001,8 @@ print_usage_bug(struct task_struct *curr, struct held_lock *this, pr_warn("\nstack backtrace:\n"); dump_stack(); + + nbcon_cpu_emergency_exit(); } /* -- 2.39.2