Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp963656rdb; Tue, 19 Sep 2023 16:12:28 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHitzQosr+El8P/L9i+XmzPrJFDl3ibK1Tl/T5E9qRZTfgshvJrZpKDyaoCe93hHWbQBmoh X-Received: by 2002:a05:6358:e497:b0:142:eb11:b0b8 with SMTP id by23-20020a056358e49700b00142eb11b0b8mr1306912rwb.1.1695165148127; Tue, 19 Sep 2023 16:12:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695165148; cv=none; d=google.com; s=arc-20160816; b=rXFKdW6TIwNNw3UKHlK3aNKPcbZhXGO7lu7W+s+7xdxeM7pf94nX1yi0t9GWs0rGYp fb/72y1l34r/FGl5vCdZ6S/8YdeV25ONnwrR2+R03VvQnkYv/7vcXgjed3QzFjBlIytk eVEAeOdh+kABiZTqItV6U9Zbadd4m3mx5H9OT7qZQ/HOAJQZTBGQy2p1XlLvenLRV3lH 8De11xxrho5fPFE+2IalMjyVJ0QKFHl6aKUGRVXyEUx+i9OTo2pKF8/ruyepnBHA/f0q mDSMfyobpC6QwG+/2fxJCk0SrcMWSyswmPGp43yjwWOKqoEUx/3Lyh9oDk1c/BESZqWZ VbjA== 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=ayShZA5Y6+vqpU4ni2cr8EGVcvIF6GWDCtcZG+RumvA=; fh=Zc51f6kezQIPGE+VpfICBLFP+oyouiLrY2CJAQIy7as=; b=O+MTAxFUmLPCQ/96kDiy3H/obo/0rTuG3f5N2+B632uavVmeBOccZtaljh0LpdBkzd 8PHc9jiElSRIRetZ6gwEvb1f1UcC9J/n4qYcUbHG7I2mEgRRGFXbB1fSjqn/ERAqQ3i9 WaUvqdZjrZSruWZqlFFI0qfjWt87I1Td2FdQ56dlxJS8BvMsFRoBpDr0HaHsVglvCPs0 +p5y9BOKUd2PW7u3MP5FrEihtedUvpSy9SwEML66VMpszHHL2nqF5SwpaHezi6ugSmmW +n61Vs82LlQ4zPsi/NJFJPpYxnTmX7Ivg4nv4lrVa1Ri4uP+LN0sdo8HME0HcFev2ruB EjQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=qWi4MpNE; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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. [23.128.96.37]) by mx.google.com with ESMTPS id x186-20020a6386c3000000b00578bb2502ccsi1538813pgd.407.2023.09.19.16.12.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 16:12:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=qWi4MpNE; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 0B0E6820DA0B; Tue, 19 Sep 2023 16:10:14 -0700 (PDT) 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 S233678AbjISXKN (ORCPT + 99 others); Tue, 19 Sep 2023 19:10:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56264 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233607AbjISXJ2 (ORCPT ); Tue, 19 Sep 2023 19:09:28 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D3817F9; Tue, 19 Sep 2023 16:09:19 -0700 (PDT) From: John Ogness DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1695164957; 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=ayShZA5Y6+vqpU4ni2cr8EGVcvIF6GWDCtcZG+RumvA=; b=qWi4MpNE17XSTOZC15znu3okHtAskd1+gALDOCzTERnor7ZLmT4BWOTJ3SSSZacqDGfiOR cUYZw1W1x/dKVngg0utCkfIoE2HXz0xvGerwCc1bZkXBztclbspNQFbye0EHFyqn5q9emC DLqD5mEO2SkvCkj1goTYsLV0as0CCSyZ85xlxLCEO9cL6IOR+LMQxJv/M9T7PfhphXQjPS dmFqj/KfCTonrYTNj2gcEpjlHU0TAKebq5Opb9Y4rv+upIs/HzvcyhQ4K4DOJK1zyCSeWK jQLdDV04pCBe6+pHsDre7Bq+V5+/U1ZkkTYjAEMYlqqZL4wwdPGScwGttJdYDw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1695164957; 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=ayShZA5Y6+vqpU4ni2cr8EGVcvIF6GWDCtcZG+RumvA=; b=1RJuv2+vauyF4pdXRf65q7Di4PvGlO48NYMcr4OCbk3zNzp+SBuVjXBekdVfdWPEbzx6t4 +dOdJccxuO8tY1DQ== To: Petr Mladek Cc: Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner , linux-kernel@vger.kernel.org, "Paul E. McKenney" , Frederic Weisbecker , Neeraj Upadhyay , Joel Fernandes , Josh Triplett , Boqun Feng , Mathieu Desnoyers , Lai Jiangshan , Zqiang , rcu@vger.kernel.org Subject: [PATCH printk v2 10/11] rcu: Add atomic write enforcement for rcu stalls Date: Wed, 20 Sep 2023 01:14:55 +0206 Message-Id: <20230919230856.661435-11-john.ogness@linutronix.de> In-Reply-To: <20230919230856.661435-1-john.ogness@linutronix.de> References: <20230919230856.661435-1-john.ogness@linutronix.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,INVALID_DATE_TZ_ABSURD, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS autolearn=ham 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]); Tue, 19 Sep 2023 16:10:14 -0700 (PDT) Invoke the atomic write enforcement functions for rcu stalls to ensure that the information gets out to the consoles. It is important to note that if there are any legacy consoles registered, they will be attempting to directly print from the printk-caller context, which may jeopardize the reliability of the atomic consoles. Optimally there should be no legacy consoles registered. Signed-off-by: John Ogness --- kernel/rcu/tree_stall.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/kernel/rcu/tree_stall.h b/kernel/rcu/tree_stall.h index 6f06dc12904a..0a58f8b233d8 100644 --- a/kernel/rcu/tree_stall.h +++ b/kernel/rcu/tree_stall.h @@ -8,6 +8,7 @@ */ #include +#include ////////////////////////////////////////////////////////////////////////////// // @@ -582,6 +583,7 @@ static void rcu_check_gp_kthread_expired_fqs_timer(void) static void print_other_cpu_stall(unsigned long gp_seq, unsigned long gps) { + enum nbcon_prio prev_prio; int cpu; unsigned long flags; unsigned long gpa; @@ -597,6 +599,8 @@ static void print_other_cpu_stall(unsigned long gp_seq, unsigned long gps) if (rcu_stall_is_suppressed()) return; + prev_prio = nbcon_atomic_enter(NBCON_PRIO_EMERGENCY); + /* * OK, time to rat on our buddy... * See Documentation/RCU/stallwarn.rst for info on how to debug @@ -651,6 +655,8 @@ static void print_other_cpu_stall(unsigned long gp_seq, unsigned long gps) panic_on_rcu_stall(); rcu_force_quiescent_state(); /* Kick them all. */ + + nbcon_atomic_exit(NBCON_PRIO_EMERGENCY, prev_prio); } static void print_cpu_stall(unsigned long gps) -- 2.39.2