From patchwork Wed Mar 15 23:54:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boqun Feng X-Patchwork-Id: 13176783 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 638A1C7618D for ; Wed, 15 Mar 2023 23:55:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233215AbjCOXzi (ORCPT ); Wed, 15 Mar 2023 19:55:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34494 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233283AbjCOXzb (ORCPT ); Wed, 15 Mar 2023 19:55:31 -0400 Received: from mail-qt1-x832.google.com (mail-qt1-x832.google.com [IPv6:2607:f8b0:4864:20::832]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F74F6133C; Wed, 15 Mar 2023 16:55:21 -0700 (PDT) Received: by mail-qt1-x832.google.com with SMTP id s12so47047qtq.11; Wed, 15 Mar 2023 16:55:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678924520; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:feedback-id:from:to:cc:subject :date:message-id:reply-to; bh=DQk4FNj9cOXKf/N0Z5hVCFZioIfls/69/wUewAHZC/M=; b=naU5Ws3oqw/MkLMhTrA04D/YEuE7vXr2frvrjxwvzMIRypxyWkaf0NSdXHEe9qN9kc YT2+u8/rRu3qhrKlBgOO1gTk/lK18DBMMzoC24sRbWnb3cKUxk92EHdJ0W1P6O/GXpUn zREX2zNcsl80me6KgGxAumFSIG6Ttq2H9guZKDOZWaVNeLnUCPIpbOrCPQgzoQlcAN6l UhYxqpU8WwkkTIziztibY0LZ6+A5Es91ps4ED6+7YLFMOmk1RW5vYhOk5OXkfWPtYQCL b8v2SzNqnEMOJNOkqVHuoJau5pmRkOu+gpXz3CNYsQXZM9wJ7TbpWZln71YjZTfSfk4Y ammg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678924520; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:feedback-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=DQk4FNj9cOXKf/N0Z5hVCFZioIfls/69/wUewAHZC/M=; b=gP4URi8zDWGEbipDdXcMCiBwPOCrDdfL7+hpqxajy+LhBI0QogV7ihRvCyBT7/PSMv T8I9HEHoZtaOyAnbP4hSq9UqKS7tgHB0wV7YNqhdq54BWkbs/0Z3MQ98VII882kueTIf jQ7w0v5ZllKVovIaEeDBvx+Y30buhBlM0NiyrIf3CnhVvJw3qIS1WSI2kiPP3osqWJ+6 /9E3iqXm3/xqHq/qtHuV8MRQ8pBO0iz33FJRIqemc5FPr5q2furD3mjk0vFNPaMBEiCR QRw/byXxXNCVer58J0r/TFM+5jPzX2DjOWKbOnjVdQxxFEo0nm6SVd0cbmAbE7lHoFne PZtw== X-Gm-Message-State: AO0yUKWxWHAqx7uFuxq3+EoXIWZBC3dK7sSscxLVA9MpuTunGXECtvWp 2JkY0AfdyoCggN/lJmlhGNE= X-Google-Smtp-Source: AK7set9O7a5+ONaI894j9lnNQHVWEM2zEhOG7CQhyZ66os9aGL+8ntoiOIq00QTyD0ynhze3jxYEKA== X-Received: by 2002:ac8:57cd:0:b0:3b8:4951:57b8 with SMTP id w13-20020ac857cd000000b003b8495157b8mr3160892qta.15.1678924520385; Wed, 15 Mar 2023 16:55:20 -0700 (PDT) Received: from auth2-smtp.messagingengine.com (auth2-smtp.messagingengine.com. [66.111.4.228]) by smtp.gmail.com with ESMTPSA id x1-20020ac87ec1000000b003bfb6ddc49dsm4608990qtj.1.2023.03.15.16.55.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Mar 2023 16:55:19 -0700 (PDT) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailauth.nyi.internal (Postfix) with ESMTP id 7FCE227C0054; Wed, 15 Mar 2023 19:55:19 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Wed, 15 Mar 2023 19:55:19 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvddvledgudehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomhepuehoqhhu nhcuhfgvnhhguceosghoqhhunhdrfhgvnhhgsehgmhgrihhlrdgtohhmqeenucggtffrrg htthgvrhhnpeegleejiedthedvheeggfejveefjeejkefgveffieeujefhueeigfegueeh geeggfenucevlhhushhtvghrufhiiigvpedvnecurfgrrhgrmhepmhgrihhlfhhrohhmpe gsohhquhhnodhmvghsmhhtphgruhhthhhpvghrshhonhgrlhhithihqdeiledvgeehtdei gedqudejjeekheehhedvqdgsohhquhhnrdhfvghngheppehgmhgrihhlrdgtohhmsehfih igmhgvrdhnrghmvg X-ME-Proxy: Feedback-ID: iad51458e:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 15 Mar 2023 19:55:19 -0400 (EDT) From: Boqun Feng To: rcu@vger.kernel.org Cc: Davidlohr Bueso , "Paul E. McKenney" , Josh Triplett , Frederic Weisbecker , Neeraj Upadhyay , Steven Rostedt , Mathieu Desnoyers , Lai Jiangshan , Joel Fernandes , Shuah Khan , Bhaskar Chowdhury , Boqun Feng , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, Zqiang Subject: [PATCH rcu 8/8] rcutorture: Create nocb kthreads only when testing rcu in CONFIG_RCU_NOCB_CPU=y kernels Date: Wed, 15 Mar 2023 16:54:54 -0700 Message-Id: <20230315235454.2993-9-boqun.feng@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230315235454.2993-1-boqun.feng@gmail.com> References: <20230315235454.2993-1-boqun.feng@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org From: Zqiang Given a non-zero rcutorture.nocbs_nthreads module parameter, the specified number of nocb kthreads will be created, regardless of whether or not the RCU implementation under test is capable of offloading callbacks. Please note that even vanilla RCU is incapable of offloading in kernels built with CONFIG_RCU_NOCB_CPU=n. And when the RCU implementation is incapable of offloading callbacks, there is no point in creating those kthreads. This commit therefore checks the cur_ops.torture_type module parameter and CONFIG_RCU_NOCB_CPU Kconfig option in order to avoid creating unnecessary nocb tasks. Signed-off-by: Zqiang Reviewed-by: Joel Fernandes (Google) Signed-off-by: Paul E. McKenney Signed-off-by: Boqun Feng --- kernel/rcu/rcutorture.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c index c0b2fd687bbb..2d1c7e15cd72 100644 --- a/kernel/rcu/rcutorture.c +++ b/kernel/rcu/rcutorture.c @@ -3525,6 +3525,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();