Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp3273923iog; Mon, 20 Jun 2022 15:53:48 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uD6PIWB6WERHhtljtG9oEjwK5s6Zc4wRKJLcv1qjO9V5/u+SokO81DlUzWlqWkgWHB+Pg8 X-Received: by 2002:a17:906:14d:b0:711:ff36:b1af with SMTP id 13-20020a170906014d00b00711ff36b1afmr23593752ejh.422.1655765628352; Mon, 20 Jun 2022 15:53:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655765628; cv=none; d=google.com; s=arc-20160816; b=OoLB527YbOLXOEpFCUPblrtF2DmWtZlHmsaR1m879E4AmheEau69xBsNU/AIIPBDrc zigmW7Qkl0ls6cbVouxARMU5QKPxZxNIsP+MuMoVabL12UgQFOle16P0C2kFsRRumlcF cbH1rTM1+OkMYSmbIbxPlh/L4FwGt7v/tu6XSH12zEwFfcamPLKTkdXyE/jnKanbgy6w wLxh7Y/Z9QQFBjXBueJQIpURQmv6Fiu6Ah2fnVQRIGfGLByFkKF38u0S6glv+nzttQFc 6/ypmNbVDolM1Kl7uL2fEhD1F8MWjf1+43D4bVbBykc6fH10v1q6mlBg38BdoOoruhZI Ygng== 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:from :dkim-signature; bh=U5DQe899jl/5ljYMvos2Wl3cX2sUtHPAlXIhCicn7B4=; b=BDO30shVTPPasW2P+hJkh5F29r9Ua7sWqkPSZWeHBdQSBwk0KgJ6Y/uw0ZpH9mK6v1 R0VnSnUmOGAcajNsQF511nBL0t+0NRqHlfDKak5YustdjGMUs7rKO5BsxhrF42k9emiF Z7l9Ig+fYnqSCT3ONrhTQzg6aKpg2ESo7X3Jv3F3P7Yh8G2rBLwvMR0HBjldJUwGucgz Akrq58PtVTbm/MUUv3KwTUjnkPrWuTWbpyOxYdOpa7PrPy7xh3298F4FYQcXPIIPz3DO 7N/oeUDe6cdRiPal8103hnZctyBy5qBfWhNlmJR583FL/j++VFpaokjcoPSHHJ9/RQyi W8Lg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Tf0sEhNy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hp8-20020a1709073e0800b00718d033df10si16182091ejc.448.2022.06.20.15.53.24; Mon, 20 Jun 2022 15:53:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Tf0sEhNy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344534AbiFTWvr (ORCPT + 99 others); Mon, 20 Jun 2022 18:51:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54718 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344175AbiFTWvd (ORCPT ); Mon, 20 Jun 2022 18:51:33 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3DB551CB10; Mon, 20 Jun 2022 15:51:32 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 50B35613F7; Mon, 20 Jun 2022 22:51:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 59B5DC341D5; Mon, 20 Jun 2022 22:51:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1655765490; bh=oMsHSf3dnE1PCs3K0mPgTlXOBWPjOTVil2QL7Pc287I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Tf0sEhNyvz9OwkVPws0rI4VEOFBxn29UvS7QiWe8ip/oReiP4pIWRpTLvr7wFe/A7 T1wfb9cetYPxZzGdN0dP7Mt6EetSEu+EiOFvupeqJyuEUEWinb0X2qflZPg0lgTqHe i3BrbHH0i6e0fPUqVxjgKKqAI5ZQLlD2ytRrYLqmUA0eF9ouJl1PjrCj3H7L8oPvjU gq065X++7ih4athDNH7Z4wHLZnUH5s5Fmwbd3+1+4/lQmSYlnXjvUXUCP3QAIjCD3R S2kjujXAgKbTSufin7CQ72X2rDtAkQacBqiZXGdKZ2qXeno+oyAI1YG/fA4vNkd4DF 4EQYkfsIJhC3A== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id A96045C0E3F; Mon, 20 Jun 2022 15:51:29 -0700 (PDT) From: "Paul E. McKenney" To: rcu@vger.kernel.org Cc: linux-kernel@vger.kernel.org, kernel-team@fb.com, rostedt@goodmis.org, Zqiang , "Paul E . McKenney" Subject: [PATCH rcu 12/12] rcu: Add irqs-disabled indicator to expedited RCU CPU stall warnings Date: Mon, 20 Jun 2022 15:51:28 -0700 Message-Id: <20220620225128.3842050-12-paulmck@kernel.org> X-Mailer: git-send-email 2.31.1.189.g2e36527f23 In-Reply-To: <20220620224943.GA3841634@paulmck-ThinkPad-P17-Gen-1> References: <20220620224943.GA3841634@paulmck-ThinkPad-P17-Gen-1> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 From: Zqiang If a CPU has interrupts disabled continuously starting before the beginning of a given expedited RCU grace period, that CPU will not execute that grace period's IPI handler. This will in turn mean that the ->cpu_no_qs.b.exp field in that CPU's rcu_data structure will continue to contain the boolean value false. Knowing whether or not a CPU has had interrupts disabled can be helpful when debugging an expedited RCU CPU stall warning, so this commit adds a "D" indicator expedited RCU CPU stall warnings that signifies that the corresponding CPU has had interrupts disabled throughout. This capability was tested as follows: runqemu kvm slirp nographic qemuparams="-m 4096 -smp 4" bootparams= "isolcpus=2,3 nohz_full=2,3 rcu_nocbs=2,3 rcutree.dump_tree=1 rcutorture.stall_cpu_holdoff=30 rcutorture.stall_cpu=40 rcutorture.stall_cpu_irqsoff=1 rcutorture.stall_cpu_block=0 rcutorture.stall_no_softlockup=1" -d The rcu_torture_stall() function ran on CPU 1, which displays the "D" as expected given the rcutorture.stall_cpu_irqsoff=1 module parameter: ............ rcu: INFO: rcu_preempt detected expedited stalls on CPUs/tasks: { 1-...D } 26467 jiffies s: 13317 root: 0x1/. rcu: blocking rcu_node structures (internal RCU debug): l=1:0-1:0x2/. Task dump for CPU 1: task:rcu_torture_sta state:R running task stack: 0 pid: 76 ppid: 2 flags:0x00004008 Signed-off-by: Zqiang Signed-off-by: Paul E. McKenney --- kernel/rcu/tree_exp.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/kernel/rcu/tree_exp.h b/kernel/rcu/tree_exp.h index 4c7037b507032..f092c7f18a5f3 100644 --- a/kernel/rcu/tree_exp.h +++ b/kernel/rcu/tree_exp.h @@ -637,10 +637,11 @@ static void synchronize_rcu_expedited_wait(void) continue; ndetected++; rdp = per_cpu_ptr(&rcu_data, cpu); - pr_cont(" %d-%c%c%c", cpu, + pr_cont(" %d-%c%c%c%c", cpu, "O."[!!cpu_online(cpu)], "o."[!!(rdp->grpmask & rnp->expmaskinit)], - "N."[!!(rdp->grpmask & rnp->expmaskinitnext)]); + "N."[!!(rdp->grpmask & rnp->expmaskinitnext)], + "D."[!!(rdp->cpu_no_qs.b.exp)]); } } pr_cont(" } %lu jiffies s: %lu root: %#lx/%c\n", -- 2.31.1.189.g2e36527f23