Received: by 2002:a05:7412:798b:b0:fc:a2b0:25d7 with SMTP id fb11csp673310rdb; Thu, 22 Feb 2024 16:26:55 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVdnzYXGFxugwjdzlcFo74rtASivJsf4Bw3EHSJWtYWFBxgA3EoClJI9DZiMI/6CetQs74RQ3eBw/Z2X4JyAgdWUdcIBlGM3i/SBjpOsw== X-Google-Smtp-Source: AGHT+IErZ/2TD4msIzKlYxkv3qFZ/qlj1+HwweI6DHb+q3/AOFWGUCk47zuZS/JqABb0oFyGb07A X-Received: by 2002:a17:906:1392:b0:a3f:a606:c397 with SMTP id f18-20020a170906139200b00a3fa606c397mr253186ejc.19.1708648015330; Thu, 22 Feb 2024 16:26:55 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708648015; cv=pass; d=google.com; s=arc-20160816; b=dnfMiE+kGcRjbWc+HQ82/+7SIUTqPHx6WKeK82C3NwIYqRrlhqw5fyf27zz9b7E9hJ NYCQcwcLWqo4ZhzpzzgaWubwrv7rkzp0jtYgST1xskuMYabW0+7exc15ZVTdbLbIZ+FN ADdztre1L6m/dbfqeyj2zvbxK2cJAbSa5VnWyej73ho5ZXAzIpmCXif96JZFPv18+eGz +h3UP8jEYvSwndjsVNFsMP2Y8Pq1Y2MJm2LS+0QNS43SkW2U6MFH0WvqPiqWL91T4UH/ 6/bMh/igPT9l6mLQP4MbjW1j6EkHgv2zTxfXTOdmt764/cewwLGkaiTKpj8znm4L2X9l A8Og== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=/WcyGHZedPCxbBSURe3/tR8GcxECX76dooKZB7wXmEY=; fh=CuxApCrUOTZt0wdMPXclSmvvEE749bqz5B9kASG95ZE=; b=vTxvT1yhH78yU+t9FEd8xdiu1WKh+CgvsvU8HRnm61FGSlMcKbY781tHYXSqgSA1EB ThTJfz/xeMCx/Dg6bhCpuHd+inh8USmVsBGjma7GRioYpL7+3MVEFGJ8labmtXOKZLEE 7SGLdLeA3n19tOOdZktoQPxSlCP51BYZzJsU/HSpKeKHi0TZJvwlJ/8dXsJiPHLh9tD8 TN4hlaUZRtlP3OgDNeqgllgzQmjNpnNCLnnorwxSHYoQifMVC4uxmgzY28YDsA57jbvy B4/B1Y5rylZ8zOUzY8f8JMuZVm1w88y7bI1Ag9M/Psz2a0Yry+gVQYS+i8/ZAbwN5hDg HsuA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XgJLx+iR; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-77573-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77573-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id h9-20020a17090634c900b00a3f26d0036bsi2217598ejb.524.2024.02.22.16.26.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 16:26:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-77573-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XgJLx+iR; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-77573-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77573-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 17B721F23964 for ; Fri, 23 Feb 2024 00:26:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 839A56119; Fri, 23 Feb 2024 00:26:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="XgJLx+iR" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A9408372; Fri, 23 Feb 2024 00:26:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708647989; cv=none; b=tebU2agpIq/Nd1+sdMArIW+PI1M9yIDP+64nqTqD3E3OyveBxDCEIdKBAW8D+bhD7o3eQWyc1ydmqvrXqAElp63mLlDzOwQoHwXNTIzrB5zOUYfRDven1lw5aom57UC0erSnMp2XtGcif2nTsME49FHbs6eGANYeCbOS93vb8oM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708647989; c=relaxed/simple; bh=dqGOB7Gat6TFDeBuXsH+ly4XsXWkpbCooGphVwFg0Ns=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=YLzYKR6ecnEt7ZD4pLgPjQtEHNn/sSTtb3HPH3TbaeQWr0q/69PEEQzx0Bs8E2AmhrDPxeadW2S5TLBTl0fiV3PPotlmnvP6gObkGoG5j1cYBc16/B3GltgrAm+6u6nfARGpTQ1Aa2MqhQQsux7WoJfPsm4heCfBcjY46tGmqxo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=XgJLx+iR; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4620FC433F1; Fri, 23 Feb 2024 00:26:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708647989; bh=dqGOB7Gat6TFDeBuXsH+ly4XsXWkpbCooGphVwFg0Ns=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XgJLx+iRcLoLouPIp30wP5iCKqNhjVA9MDeOFPxr3EQT5X2Im5qs+CpPm6mvHxia/ fT92RWI2wOPAq5Dpp2WdvHz2/7pUxqCPxAYxqdQi67JldTnLeRwOLgEBKztXtAebao 8IfrFnm4WxPjajnoQw6D96NC8VPXsO86bnnIU1PbQ1s6NqxbWUuS75sLp8bctoYdaO ZTTyb79sfZLA/ziSTcCLe+KEFOiTNG0nKrPrze4qrgbbaOJvvFHM5ecfR1gWi6Aaow YVUrcaDYgZUWZWkWbb/C2RhzRVULh1od1pXBB0r9NiITewu8jHeW67ozXcIBcjbMwL p2Xbav3BHnKyg== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id EC969CE0B71; Thu, 22 Feb 2024 16:26:28 -0800 (PST) From: "Paul E. McKenney" To: rcu@vger.kernel.org Cc: linux-kernel@vger.kernel.org, kernel-team@meta.com, rostedt@goodmis.org, "Paul E. McKenney" , Ankur Arora , Thomas Gleixner , Mark Rutland Subject: [PATCH rcu 1/4] rcu: Create NEED_TASKS_RCU to factor out enablement logic Date: Thu, 22 Feb 2024 16:26:24 -0800 Message-Id: <20240223002627.1987886-1-paulmck@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <8c938bd5-6d62-4eff-9289-13b0d7ae8e17@paulmck-laptop> References: <8c938bd5-6d62-4eff-9289-13b0d7ae8e17@paulmck-laptop> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Currently, if a Kconfig option depends on TASKS_RCU, it conditionally does "select TASKS_RCU if PREEMPTION". This works, but requires any change in this enablement logic to be replicated across all such "select" clauses. This commit therefore creates a new NEED_TASKS_RCU Kconfig option so that the default value of TASKS_RCU can depend on a combination of this new option and any needed enablement logic, so that this logic is in one place. While in the area, also anticipate a likely future change by adding PREEMPT_AUTO to that logic. Signed-off-by: Paul E. McKenney Cc: Ankur Arora Cc: Thomas Gleixner Cc: Mark Rutland Cc: Steven Rostedt --- kernel/rcu/Kconfig | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/kernel/rcu/Kconfig b/kernel/rcu/Kconfig index 7dca0138260c3..3e079de0f5b43 100644 --- a/kernel/rcu/Kconfig +++ b/kernel/rcu/Kconfig @@ -85,9 +85,13 @@ config FORCE_TASKS_RCU idle, and user-mode execution as quiescent states. Not for manual selection in most cases. -config TASKS_RCU +config NEED_TASKS_RCU bool default n + +config TASKS_RCU + bool + default NEED_TASKS_RCU && (PREEMPTION || PREEMPT_AUTO) select IRQ_WORK config FORCE_TASKS_RUDE_RCU -- 2.40.1