Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp3679139ioo; Wed, 25 May 2022 06:03:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzFaJZCDsaMAcMkOaq+tP5Jl9FLBs7HVyH5Dp34Z8e9Q9sB2EBByJrw7uFrQKhCOKFWqJ7C X-Received: by 2002:a05:6402:27d4:b0:42a:ed61:c591 with SMTP id c20-20020a05640227d400b0042aed61c591mr33746853ede.361.1653483820354; Wed, 25 May 2022 06:03:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653483820; cv=none; d=google.com; s=arc-20160816; b=Q6yubCPd0VNFzh2zLj2kAblcI02CDa5mUfNiax4XT0sv40nMprjvMqToKAarmXLYyp LixAJzD6INPS1+n5+Pc3NO+x9eCWS2gwB0yhyCljb0GcmBHJuwwsmXKvYBSOJ3xua7lz e95Usj+tl3hJtmSRFYNiiYw0NXptqlD/L8SQiL5/4jk6SJQ9lYRGmhbdbmxNHoqmTMtA a5WK21WC58Q953Q/Jmc+P99Eo4/eeyWsqAVE44DFmqRGs0DOuaks9dGpKRLIUdj+4Ywi WU71Gdqs0bhvMCbfR71jHB15czBr5qUb8TqTg7z3xSioQ9eG1cYs6Kf4ZJCG1LEr/rbZ 9TCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=nEAyTJOdRBehDHHmeCA8nAnq7gmElWIt7+YFR+MXpkU=; b=AMcSWHjSz0tU6sCOATaa+PSRrsQ2KQhssAHZ3sCkcJ5txR23p72F+Cvove1kU+ClkI 5Wpt8RYtUC2mUBZNpkBz/trKc0/0FAiUUAv9IeIbbq3ixeI2Ig4OPvV9Q/9o0MzrCmJR lRNGh/jx1KstJgyJ7gWPbPSzAXwvbXdL2W+Z+mgWa6HMtV7CXebV2xFIVDiEjFrrvFRb uMbXWYb5ww4B3act9zo57RRUSO6jhmG4kjQ2lzAmt4gUZcz0Z4BIAjxCgRqc/ppBKDzd okxAzwuLupnuzleJOHAdXBYYXh9QNATY4NdWwBRtRsVHDDyZONryYopBZauaUeFk7Na9 pSEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=v1zKIWBS; 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=quicinc.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g21-20020a056402425500b0042b01d1b95asi22299193edb.363.2022.05.25.06.03.11; Wed, 25 May 2022 06:03:40 -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=@quicinc.com header.s=qcdkim header.b=v1zKIWBS; 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=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243503AbiEYL51 (ORCPT + 99 others); Wed, 25 May 2022 07:57:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36452 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243392AbiEYL5P (ORCPT ); Wed, 25 May 2022 07:57:15 -0400 Received: from alexa-out-sd-01.qualcomm.com (alexa-out-sd-01.qualcomm.com [199.106.114.38]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B28BE1FCC5; Wed, 25 May 2022 04:57:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1653479820; x=1685015820; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=nEAyTJOdRBehDHHmeCA8nAnq7gmElWIt7+YFR+MXpkU=; b=v1zKIWBS0d/5Esa7+dQ4SoPNvIZSnHXheQuDUaDu02s5jFb1frij+FdE cQ/6C7eHY3h6t8dVn+OXNHu0a+BI2S+mbRk8iQvxIuLiRgDYRn+CCN0p0 Ow1munqTRf+r2QrPyK9GBTErbGZUW6yLADvitNpILgE2buDlah2EkPSo/ s=; Received: from unknown (HELO ironmsg03-sd.qualcomm.com) ([10.53.140.143]) by alexa-out-sd-01.qualcomm.com with ESMTP; 25 May 2022 04:57:00 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg03-sd.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 May 2022 04:56:59 -0700 Received: from [10.216.2.173] (10.80.80.8) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Wed, 25 May 2022 04:56:57 -0700 Message-ID: <7b641200-88b1-8d45-7068-3e9f4d9e0530@quicinc.com> Date: Wed, 25 May 2022 17:26:52 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: [PATCH] rcu: Fix incorrect judgment condition in show_rcu_nocb_state() Content-Language: en-US To: Zqiang , , CC: , References: <20220525033430.1953349-1-qiang1.zhang@intel.com> From: Mukesh Ojha In-Reply-To: <20220525033430.1953349-1-qiang1.zhang@intel.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nasanex01c.na.qualcomm.com (10.47.97.222) X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, 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 On 5/25/2022 9:04 AM, Zqiang wrote: > When check the 'rdp->nocb_cb_kthread' tasks exists, if is true, however > the output is the cpu where 'rdp->nocb_gp_kthread' is located. this > ensure that the tasks in the judgment condition and the tasks of the > cpu where the output tasks are located are the same tasks. > > Signed-off-by: Zqiang > --- > kernel/rcu/tree_nocb.h | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/kernel/rcu/tree_nocb.h b/kernel/rcu/tree_nocb.h > index fa8e4f82e60c..f4ee81d119c8 100644 > --- a/kernel/rcu/tree_nocb.h > +++ b/kernel/rcu/tree_nocb.h > @@ -1438,8 +1438,8 @@ static void show_rcu_nocb_gp_state(struct rcu_data *rdp) > (long)rdp->nocb_gp_seq, > rnp->grplo, rnp->grphi, READ_ONCE(rdp->nocb_gp_loops), > rdp->nocb_gp_kthread ? task_state_to_char(rdp->nocb_gp_kthread) : '.', > - rdp->nocb_cb_kthread ? (int)task_cpu(rdp->nocb_gp_kthread) : -1, > - show_rcu_should_be_on_cpu(rdp->nocb_cb_kthread)); > + rdp->nocb_gp_kthread ? (int)task_cpu(rdp->nocb_gp_kthread) : -1, > + show_rcu_should_be_on_cpu(rdp->nocb_gp_kthread)); > } > > /* Dump out nocb kthread state for the specified rcu_data structure. */ > @@ -1483,7 +1483,7 @@ static void show_rcu_nocb_state(struct rcu_data *rdp) > ".B"[!!rcu_cblist_n_cbs(&rdp->nocb_bypass)], > rcu_segcblist_n_cbs(&rdp->cblist), > rdp->nocb_cb_kthread ? task_state_to_char(rdp->nocb_cb_kthread) : '.', > - rdp->nocb_cb_kthread ? (int)task_cpu(rdp->nocb_gp_kthread) : -1, > + rdp->nocb_cb_kthread ? (int)task_cpu(rdp->nocb_cb_kthread) : -1, > show_rcu_should_be_on_cpu(rdp->nocb_cb_kthread)); > Nice !! Reviewed-by: quic_mojha@quicinc.com -Mukesh > /* It is OK for GP kthreads to have GP state. */