Message ID | 20230203014021.3408798-1-qiang1.zhang@intel.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp583446wrn; Thu, 2 Feb 2023 17:41:57 -0800 (PST) X-Google-Smtp-Source: AK7set88blRkY/fWieRa6UGNtii/rQIH4bjHXmKmSpGbCMfo5H0T/GPBWE54UgG1fE6HEmBDhbT/ X-Received: by 2002:a17:90a:53:b0:22b:f834:3fac with SMTP id 19-20020a17090a005300b0022bf8343facmr8789046pjb.11.1675388517449; Thu, 02 Feb 2023 17:41:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675388517; cv=none; d=google.com; s=arc-20160816; b=Y5kcyIui74Lly2PVfjjT+fw8dAITYLaiE3kLsboN055ZrAjPvWliRSY0BDUJl9djb0 BAJ8wTk7+1cR7nRByQtJ0bW8vFSFJuQxuWz3UOdXa4Z1csFd0JhiMc+r6AbjWij3JvH+ +wFir25/Osm4nT62c5QoRaXY3kpKGjVeWavaOiHE5FSRExN7wQrM3aDSX7g1o/FwyZB5 MEuFXwEJMZ1mN8b4nP1oyuPN/D9L0d6sZ1OjmtOOL+2JGHn5pw0Ue8Fh/ewzGOE0lh9I SiUJTsS7zMgaDuj1CAjB6UcMTxMBjA5TQ/Q1kSLV3oQOKlYa/8oQl0dZzdHR+2rXDzfl solA== 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=2EnoQZLDwin1UnR7vkmvUT/2xmBW2hggClD0KK/bDvo=; b=was1Z/qiYOEpcgWjQ0zleM/3IGUyUHkbm8lRVG08ZlKCxaISjZR9llTLrVy4q8yaI4 Smpn5Afqsfjxexqe9ZRkRcww28V3ldwJwX+p+VGhrZn/ODKAg6KzQdsCznnwp+LZOAEA g4pbKTrd6srjH+gn416n82sbff29Kq9qga5mXuMGjsBhyZ8/NbjOnk3z3FU7srSA2CGx IdZpWTLg9+llKvW2E3WPLRYk7FCyCrE8o0jk71BNZY9QiV3/J+aMEUkeGc6XyEBVmZY0 gAhJECcg2KDZRwFr7kM2ywn97l5LgFrRitsgCD5kXcK+9V+zco7vqOtTxVyrcj3DOwph ZVNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=UvpZVXcV; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i16-20020a17090a059000b00229454a4a5fsi1266218pji.143.2023.02.02.17.41.45; Thu, 02 Feb 2023 17:41:57 -0800 (PST) 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=UvpZVXcV; 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 S231897AbjBCBfh (ORCPT <rfc822;il.mystafa@gmail.com> + 99 others); Thu, 2 Feb 2023 20:35:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57880 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231438AbjBCBff (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 2 Feb 2023 20:35:35 -0500 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 23C39841A0; Thu, 2 Feb 2023 17:35:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1675388134; x=1706924134; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=71piuBCEe2+vVRwtacCxx8j39fJadVo2ugu2BE7Iu/4=; b=UvpZVXcVPellXE/DBbyOa8H/FEkvigWvHkr6CAR449zS2MnS2/x/5nUa k26BkvFvQtG5JxGEuYmGA1FRTRW9XzIoSFZcMm5UWgFKQisLll2K7z0xn idLmzESMSStjIhlN1A7ylePg8rTmvdLn36gsXj5Z8MLO/hf9mNmiF+wEI iU31ZT7PxL0TX6iWOq/Jw1qaZ8BZBEaa4zE2EsYKQHywrYl9pgusA0vRw g+d4jnb2udm2UU+AFE37vw9jKSogYf4XMpqC8SMqqvf7VrUccEmRgC9ER tyaxWQkq2InYW/TjvYGBUgpcCyNg9iAbDPuC/HfQiEX4/HUAaINdP+zaw w==; X-IronPort-AV: E=McAfee;i="6500,9779,10609"; a="414836810" X-IronPort-AV: E=Sophos;i="5.97,269,1669104000"; d="scan'208";a="414836810" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Feb 2023 17:35:17 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10609"; a="697900501" X-IronPort-AV: E=Sophos;i="5.97,269,1669104000"; d="scan'208";a="697900501" Received: from zq-optiplex-7090.bj.intel.com ([10.238.156.129]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Feb 2023 17:35:15 -0800 From: Zqiang <qiang1.zhang@intel.com> To: paulmck@kernel.org, frederic@kernel.org, quic_neeraju@quicinc.com, joel@joelfernandes.org Cc: rcu@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3] rcutorture: Create nocb tasks only for CONFIG_RCU_NOCB_CPU=y kernels Date: Fri, 3 Feb 2023 09:40:21 +0800 Message-Id: <20230203014021.3408798-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=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756700833944506902?= X-GMAIL-MSGID: =?utf-8?q?1756772190330193694?= |
Series |
[v3] rcutorture: Create nocb tasks only for CONFIG_RCU_NOCB_CPU=y kernels
|
|
Commit Message
Zqiang
Feb. 3, 2023, 1:40 a.m. UTC
When setting nocbs_nthreads to start rcutorture test with a non-zero value,
the nocb tasks will be created and invoke rcu_nocb_cpu_offload/deoffload()
to toggle CPU's callback-offload state, but for CONFIG_RCU_NOCB_CPU=n
kernel, the rcu_nocb_cpu_offload/deoffload() is a no-op and this is also
meaningless for torture_type is non-rcu.
This commit therefore add member can_nocbs_toggle to rcu_torture_ops
structure to avoid unnecessary nocb tasks creation.
Signed-off-by: Zqiang <qiang1.zhang@intel.com>
---
kernel/rcu/rcutorture.c | 6 ++++++
1 file changed, 6 insertions(+)
Comments
>When setting nocbs_nthreads to start rcutorture test with a non-zero value, >the nocb tasks will be created and invoke rcu_nocb_cpu_offload/deoffload() >to toggle CPU's callback-offload state, but for CONFIG_RCU_NOCB_CPU=n >kernel, the rcu_nocb_cpu_offload/deoffload() is a no-op and this is also >meaningless for torture_type is non-rcu. > >This commit therefore add member can_nocbs_toggle to rcu_torture_ops >structure to avoid unnecessary nocb tasks creation. Will change commit log next version. Thanks Zqiang > >Signed-off-by: Zqiang <qiang1.zhang@intel.com> >--- > kernel/rcu/rcutorture.c | 6 ++++++ > 1 file changed, 6 insertions(+) > >diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c >index 297da28ce92d..d01127e0e8cd 100644 >--- a/kernel/rcu/rcutorture.c >+++ b/kernel/rcu/rcutorture.c >@@ -3708,6 +3708,12 @@ rcu_torture_init(void) > pr_alert("rcu-torture: ->fqs NULL and non-zero fqs_duration, fqs disabled.\n"); > fqs_duration = 0; > } >+ if (nocbs_nthreads != 0 && (cur_ops != &rcu_ops || >+ !IS_ENABLED(CONFIG_RCU_NOCB_CPU))) { >+ pr_alert("rcu-torture types: %s and CONFIG_RCU_NOCB_CPU=%d, nocb toggle disabled.\n", >+ cur_ops->name, IS_ENABLED(CONFIG_RCU_NOCB_CPU)); >+ nocbs_nthreads = 0; >+ } > if (cur_ops->init) > cur_ops->init(); > >-- >2.25.1
On Thu, Feb 2, 2023 at 8:35 PM Zqiang <qiang1.zhang@intel.com> wrote: > > When setting nocbs_nthreads to start rcutorture test with a non-zero value, > the nocb tasks will be created and invoke rcu_nocb_cpu_offload/deoffload() > to toggle CPU's callback-offload state, but for CONFIG_RCU_NOCB_CPU=n > kernel, the rcu_nocb_cpu_offload/deoffload() is a no-op and this is also > meaningless for torture_type is non-rcu. > > This commit therefore add member can_nocbs_toggle to rcu_torture_ops > structure to avoid unnecessary nocb tasks creation. > > Signed-off-by: Zqiang <qiang1.zhang@intel.com> Reviewed-by: Joel Fernandes (Google) <joel@joelfernandes.org> thanks, - Joel > --- > kernel/rcu/rcutorture.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c > index 297da28ce92d..d01127e0e8cd 100644 > --- a/kernel/rcu/rcutorture.c > +++ b/kernel/rcu/rcutorture.c > @@ -3708,6 +3708,12 @@ rcu_torture_init(void) > pr_alert("rcu-torture: ->fqs NULL and non-zero fqs_duration, fqs disabled.\n"); > fqs_duration = 0; > } > + if (nocbs_nthreads != 0 && (cur_ops != &rcu_ops || > + !IS_ENABLED(CONFIG_RCU_NOCB_CPU))) { > + pr_alert("rcu-torture types: %s and CONFIG_RCU_NOCB_CPU=%d, nocb toggle disabled.\n", > + cur_ops->name, IS_ENABLED(CONFIG_RCU_NOCB_CPU)); > + nocbs_nthreads = 0; > + } > if (cur_ops->init) > cur_ops->init(); > > -- > 2.25.1 >
diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c index 297da28ce92d..d01127e0e8cd 100644 --- a/kernel/rcu/rcutorture.c +++ b/kernel/rcu/rcutorture.c @@ -3708,6 +3708,12 @@ rcu_torture_init(void) pr_alert("rcu-torture: ->fqs NULL and non-zero fqs_duration, fqs disabled.\n"); fqs_duration = 0; } + if (nocbs_nthreads != 0 && (cur_ops != &rcu_ops || + !IS_ENABLED(CONFIG_RCU_NOCB_CPU))) { + pr_alert("rcu-torture types: %s and CONFIG_RCU_NOCB_CPU=%d, nocb toggle disabled.\n", + cur_ops->name, IS_ENABLED(CONFIG_RCU_NOCB_CPU)); + nocbs_nthreads = 0; + } if (cur_ops->init) cur_ops->init();