Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp717581iob; Wed, 18 May 2022 11:19:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyTjVFdhy+JCD6swRuSL6NAD05nGVTb2mNW5lKoiO3hvk4n9uCm9Bq8At0qCnxM1YbVhAJH X-Received: by 2002:a05:6a00:1492:b0:50e:11ae:f62f with SMTP id v18-20020a056a00149200b0050e11aef62fmr828753pfu.43.1652897958356; Wed, 18 May 2022 11:19:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652897958; cv=none; d=google.com; s=arc-20160816; b=w7iD+K2tG+QH75WE8wcPuZE/f4VntinQyZYsC2MxYRObx9p+1yBGCrz1pcfp4C0gex mxQe7QKJgJ1m+F6gduORQrzAYfbQZTWbHfUM74ds8B2LKsAiZxSF+vkpDhiyj9K7DFn3 u0XJCymuOleOzTOi/G3kQtnHE3UnoWgvHmPRZsS9o1EMI8gTbVXSvPavm8FcQbJAYzjv j53RCQsTTpjr0I6FJRhvrSO4UOfI6yYUju0rcGHZFd0C0VR7Q1ndioXPIWnKdaIypwur XO810+Qm3OC6ARQhOOiwSo9IxGyQUuec+pZoUprPNd0snvTL0wKuQDYV/wp9Cf1yiM1O 5sOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=WRiF46X78S0zDiexQb8gUCIqQg7LyL9d1FCwdLTF4dk=; b=xwVONO+Wn9YFgIhX0SjZEKa5Mo3UBoeiXGPmaO7yVuwRXyWo1ZJ3q9/p9IjPj2ws9h 6U2Sad7FVdI1FP/WWJssptsdvkjMT59+cc+jJyq11+9hss6Xbnruo3L4YD635iJQW9bl FX5pmqWH8L9RR85DTulpkaiyRz0dagPpW/KIRIg4lzhJHyV0BpmwiR4qx3XwRk3V1B7O r4uAG0BiQo0oCw4GtnyA7g81nACLF/HdR9SNE0jE03/+Jjs2DYGFkiu+Al9Dg4sP7aw1 ZFNGV5L0TOqSklCvqmMfU4SEeS7Lf2RC8qJahvFKWphDG4Xbym8KTjO7nGO2vVB5XnR+ iEkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QkXS9DmF; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id i3-20020a17090a4b8300b001cabc409081si3709778pjh.67.2022.05.18.11.19.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 May 2022 11:19:18 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QkXS9DmF; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id DCED8177883; Wed, 18 May 2022 11:14:45 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235558AbiERSO3 (ORCPT + 99 others); Wed, 18 May 2022 14:14:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234057AbiERSO1 (ORCPT ); Wed, 18 May 2022 14:14:27 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D7AAB16A277; Wed, 18 May 2022 11:14:25 -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 ams.source.kernel.org (Postfix) with ESMTPS id 89D1EB82019; Wed, 18 May 2022 18:14:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 43327C385A5; Wed, 18 May 2022 18:14:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1652897663; bh=HXcgqQoC2j8uMdZbslQ5dj2wJLQUBcNJqdHvlFwHJ/A=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=QkXS9DmFT0x0MJgHh4vg9bjRKA0Sfa5QT1m+UQTOO2/1gK5AETm0+/zlg2jZYLfYl NVsFvdgKFtQIGvicTy8Sn/gdo4OV0Z9+kRoUmHecC4xLkNGiFBAEIH1CnNjpDTsK1Y FlQDAzrjNFI/mlVILP4bz+fSon6upBDIlLQdmwRscts8CnH8n7L1MAfickowlJqKMl uuv4frt8pK84aJAGfnT5yjfWYvgrzOKJUw88j6WU4tho3MRal5w0MnV02zvOJdq7lQ TPCjT/QBT4/bMh7tuPkavYf91FEBTGFCuwbfmifsS1dvLCrLicchZAgmPB6UQQlqPE R60gBY1XZWt4g== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id D06605C042D; Wed, 18 May 2022 11:14:22 -0700 (PDT) Date: Wed, 18 May 2022 11:14:22 -0700 From: "Paul E. McKenney" To: Zqiang Cc: frederic@kernel.org, rcu@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] rcu: Add cpu-exp indicator to expedited RCU CPU stall warnings Message-ID: <20220518181422.GR1790663@paulmck-ThinkPad-P17-Gen-1> Reply-To: paulmck@kernel.org References: <20220518114310.1478091-1-qiang1.zhang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220518114310.1478091-1-qiang1.zhang@intel.com> X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 On Wed, May 18, 2022 at 07:43:10PM +0800, Zqiang wrote: > This commit adds a "D" indicator to expedited RCU CPU stall warnings. > when an expedited grace period begins, due to CPU disable interrupt > time too long, cause the IPI(rcu_exp_handler()) unable to respond in > time, this debugging id will be showed. > > 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 > > rcu_torture_stall start on CPU 1. > ............ > 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 Nice!!! I have queued this for v5.20 and for further testing and review, thank you! As usual, I could not resist the temptation to wordsmith the commit log, so could you please check it in case I messed something up? Thanx, Paul ------------------------------------------------------------------------ commit 178b9d47f3049e8122738c3166ee4975b75cba55 Author: Zqiang Date: Wed May 18 19:43:10 2022 +0800 rcu: Add irqs-disabled indicator to expedited RCU CPU stall warnings 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 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",