Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp3508894ioo; Wed, 25 May 2022 02:08:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwZ5/kz5C0Vv5FdkQE1nUo/s23M57RdqpjuYVfcXgIGkr2ZJom2LP8lw0JNDq11h6MW72ZQ X-Received: by 2002:a05:6402:34d4:b0:42b:35e5:fc78 with SMTP id w20-20020a05640234d400b0042b35e5fc78mr23324382edc.372.1653469690683; Wed, 25 May 2022 02:08:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653469690; cv=none; d=google.com; s=arc-20160816; b=RQXltjgvwTSFWgleXvGF9/wiTnsrbo/IMO57mgXVQHp+wk71GDIo8Br++1J1axvpqH qJVLsB5GEisU23os8l2bd0Y8Z2Ks00EvDjgT4hBCl+GTNwhQq+AH08YxK9E61wv1Eqoz KKRNQ61yXQGwuNY+IiJS6T9u0a6+T66AyJWGryyuJ8fNylw/xGgJPUmtu3fBKXDPjhij TN2O6dMa9PaAjhaAB3MoCHAumwn84Q1JdqYd7kuzT41r6/JLVWGmLcr9ayKkAi8V4lT6 aaY9wiYKS3tY2T5PAW0W2abDQSQi+1ydW/a2mI5Mtny29rs0lJLdFrv7FVQo/ESIvhRd oPww== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=1vKEmElaUO/H7QpsV0OHNfHB8tnpw4PeVteRfMLt2Z0=; b=KkjBVXBJfgfhIK8ydT0U3J0hkVlqQXlrvQY9TdOQzKIRyWZRbNelfrsQNh6M9UiqPt X5iI78vjkikHR5xa+jAQzImRPH6d0wHfcsPdNk4PDNAvJr/90aHak4p4ditbrCPm7TRb R1AJ435YPgdhLrcwDbKZr9AbBo9r1K8BNpdyVhMgImV2i5VQwX9n20FEiPNYsRtGnDoX q+4JcLm0n1ureA3dYFc1K0pzFQfnoLiurwbSgxtbe8x3oTjoUg0Hdf43eNyYM2HCay/y 2EygFfHx5C5FD7xyWH6rOHEbIywK2MT6rPWFQqtVPaBUgKy3M+lZ4xvL509SgsAS2Ult Vuaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=T+KoRKHF; 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=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r17-20020a05640251d100b0042a8f6d3781si25305663edd.311.2022.05.25.02.07.43; Wed, 25 May 2022 02:08:10 -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=@intel.com header.s=Intel header.b=T+KoRKHF; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243120AbiEYDeg (ORCPT + 99 others); Tue, 24 May 2022 23:34:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56130 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242067AbiEYDef (ORCPT ); Tue, 24 May 2022 23:34:35 -0400 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F0A1F7893F; Tue, 24 May 2022 20:34:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1653449673; x=1684985673; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=KdtnY983uARnCJjXy5Kw61Z7shQrGiGIoJu3KXw7P98=; b=T+KoRKHF7lO9uRrdHk4YeF7+aA56rtnkL7csqlG1hCf1ekVuZMYDUjVd 1XViD1pm9g9xr5FP6Yu00JQTH1NKaQsWM1sWy2j9gO1oPLbRirwYRc60X GOJToSVptFTz7LHc4zYz/n916pcLvMwKorG9VEy4Kxx+kkgXqjKKwfBub Os5RkGwqFM24ldMnA7TJwlWmq13jx46FMmNMWQdAVpwGCqtTUIsaIXaPm TSLsrkZgJG+CWlPiNuW3R8AxcbM0rffUfdeWG2MtS9Aro4KvVVwVEPUVt VmC7iGuyr999fbfDBoxsQzxva4Zogr+6mM3ATQyYbQ/e5dkohcsXAcQ9m g==; X-IronPort-AV: E=McAfee;i="6400,9594,10357"; a="261316106" X-IronPort-AV: E=Sophos;i="5.91,250,1647327600"; d="scan'208";a="261316106" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 May 2022 20:34:33 -0700 X-IronPort-AV: E=Sophos;i="5.91,250,1647327600"; d="scan'208";a="548798018" Received: from zq-optiplex-7090.bj.intel.com ([10.238.156.125]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 May 2022 20:34:32 -0700 From: Zqiang To: paulmck@kernel.org, frederic@kernel.org Cc: rcu@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] rcu: Fix incorrect judgment condition in show_rcu_nocb_state() Date: Wed, 25 May 2022 11:34:30 +0800 Message-Id: <20220525033430.1953349-1-qiang1.zhang@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, 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 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)); /* It is OK for GP kthreads to have GP state. */ -- 2.25.1