From patchwork Thu Jan 16 20:13:19 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Paul E. McKenney" X-Patchwork-Id: 13942201 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 F1E582361DA; Thu, 16 Jan 2025 20:13: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=1737058410; cv=none; b=Zv68jDhsV7sXvtSkuIul9QXcnY3724laHanilxkmeaflLejIVCk9vjOMmQCXVRu0+HrP/QIsIt0RVWuZOnCCJLm3A71p6d/TwOORpUZcgdaZ7L0CihZPPy50WLjB37u4UjNXv7nGCm2o6ljPnQ0VZ42OGZg0K59jLpQjEPVLzOY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737058410; c=relaxed/simple; bh=2kCcpwrxC+sFJfs74p9b/NIfUYLNRgHwpLZRtUNE9V0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=aWElAjj2CFNqby6Zm4zL+qhXjG0fvNXV/d2vVKyvrW3YIrGloU6bdoHYxFt25pdAx+nQ2iGi4eppTCoLR1pICWMTTigFQ9MjMGeBZl9hSEBTOopSMRZOhpl8dyNPjW3H2ZywQRXI9/Cz8YfyLYkG5YJwRYwLUR6eZuP5+YUs7IY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=EftLCmGh; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="EftLCmGh" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 924AEC4CED6; Thu, 16 Jan 2025 20:13:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1737058409; bh=2kCcpwrxC+sFJfs74p9b/NIfUYLNRgHwpLZRtUNE9V0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EftLCmGh+enD1SyXPE7Y7u1LRrwuoIdHkG63yGpyiGGuXD2JqLJnQ85L31DBgmxPZ mvC5zlxq174sSOXz6+W7fovl6g3QSdce5d5kW6SOE+6+oFTPoBcpHKpsxCTqnOOWsa K58CuJpzpAYynbqiukXCsX01qrlx0fbaRi+S0V4PPX7ZsxpHj7X7She3FLGB8MkA0T ho/QHbasEWAw6i17Q1DT0qYV4TQdfKOEqS8caZXW5JEjpzaH/j1lKdcvRdflGGhXd9 rQm29pf5bPJyUJKAB0YYXrWq5oRI8Et4YiKmiT3XqguEcPJfaqFq2ev9pHqnsRvC9X rYhwzsegbABrg== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 4A827CE12BE; Thu, 16 Jan 2025 12:13:29 -0800 (PST) From: "Paul E. McKenney" To: rcu@vger.kernel.org Cc: linux-kernel@vger.kernel.org, kernel-team@meta.com, rostedt@goodmis.org, Ankur Arora , "Paul E . McKenney" , Frederic Weisbecker , Sebastian Andrzej Siewior Subject: [PATCH rcu 1/9] rcu: fix header guard for rcu_all_qs() Date: Thu, 16 Jan 2025 12:13:19 -0800 Message-Id: <20250116201327.3782963-1-paulmck@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: rcu@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Ankur Arora rcu_all_qs() is defined for !CONFIG_PREEMPT_RCU but the declaration is conditioned on CONFIG_PREEMPTION. With CONFIG_PREEMPT_LAZY, CONFIG_PREEMPTION=y does not imply CONFIG_PREEMPT_RCU=y. Decouple the two. Cc: Paul E. McKenney Reviewed-by: Frederic Weisbecker Reviewed-by: Sebastian Andrzej Siewior Signed-off-by: Ankur Arora Signed-off-by: Paul E. McKenney --- include/linux/rcutree.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/rcutree.h b/include/linux/rcutree.h index 27d86d9127817..aad586f15ed0c 100644 --- a/include/linux/rcutree.h +++ b/include/linux/rcutree.h @@ -103,7 +103,7 @@ extern int rcu_scheduler_active; void rcu_end_inkernel_boot(void); bool rcu_inkernel_boot_has_ended(void); bool rcu_is_watching(void); -#ifndef CONFIG_PREEMPTION +#ifndef CONFIG_PREEMPT_RCU void rcu_all_qs(void); #endif From patchwork Thu Jan 16 20:13:20 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Paul E. McKenney" X-Patchwork-Id: 13942199 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 F1EB52361DE; Thu, 16 Jan 2025 20:13: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=1737058410; cv=none; b=G0G3r7CRcNrQNBe8Fdq20fEGfcNkqILH2td+lda+Bmitqmbki7wYnB/bifuYK0J6MdUqeHaPJbqTn7siuOHW4kCqiLg7qbfcrxuCSrQHioYrKa3v6VClUjEQAc825XsWCYgr7ImM2zb41bZ0jd2IX+2BQiOK6NSCKht+ldunECI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737058410; c=relaxed/simple; bh=UlkuzeoqMzYgR+og5Wa1i/pWnGmyFhloUaxNTrXLAcY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=idwn1ZPZTjM0AeNKsE8cX4MzekX5o582nv896llAOotnx6Kq9FYuMKtZs56kMzbYDKFMHz7Crb94VSNEV0KQ3qBaPZVIYiS7oL+EdaQzwb/XRmLkYdCEowg+3lq5lL93TFG8tdlpdcaT370fUfvXc4OKuOLz+s7eqgJG9vK82KI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=eL1tsiJX; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="eL1tsiJX" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A21C2C4CEDF; Thu, 16 Jan 2025 20:13:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1737058409; bh=UlkuzeoqMzYgR+og5Wa1i/pWnGmyFhloUaxNTrXLAcY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eL1tsiJX0l3qAYVtd8nXR0IM9MDWdFw5QOSYAFEEf+WC23k8BvEjd1SRpS0z48iem OkuuYEQVkqixEgbm/gPsweYCmYAyj/SlchGB+n8X6Lijg6aseLYA36M0dFPp9M5Ws1 eb2BFHVGeijUcQMB+QzhCF3b4YWIJJjJgH65LGTEt65OOJBaDJ2SkLwYNoFlTNDY6x Fy0NJoo5Yxm2in53WPAoaMbngMUknYX3C1cfNsl+eHOkny0+s+yNUpUQPAm8zZjUY0 N74QPWWe7bO8oiENy+bJnJgY0qgwZv7rIYJZ0SNX15A3qfDSyWk2JvJjpdy1DxDw7s s/1BtBeJY170w== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 4CE74CE13C4; Thu, 16 Jan 2025 12:13:29 -0800 (PST) From: "Paul E. McKenney" To: rcu@vger.kernel.org Cc: linux-kernel@vger.kernel.org, kernel-team@meta.com, rostedt@goodmis.org, Ankur Arora , "Paul E . McKenney" , Frederic Weisbecker , Sebastian Andrzej Siewior Subject: [PATCH rcu 2/9] rcu: rename PREEMPT_AUTO to PREEMPT_LAZY Date: Thu, 16 Jan 2025 12:13:20 -0800 Message-Id: <20250116201327.3782963-2-paulmck@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: rcu@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Ankur Arora Replace mentions of PREEMPT_AUTO with PREEMPT_LAZY. Also, since PREMPT_LAZY implies PREEMPTION, we can reduce the TASKS_RCU selection criteria from: NEED_TASKS_RCU && (PREEMPTION || PREEMPT_AUTO) to: NEED_TASKS_RCU && PREEMPTION CC: Paul E. McKenney Reviewed-by: Frederic Weisbecker Reviewed-by: Sebastian Andrzej Siewior Signed-off-by: Ankur Arora Signed-off-by: Paul E. McKenney --- include/linux/srcutiny.h | 2 +- kernel/rcu/Kconfig | 2 +- kernel/rcu/srcutiny.c | 14 +++++++------- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/include/linux/srcutiny.h b/include/linux/srcutiny.h index 1321da803274d..31b59b4be2a74 100644 --- a/include/linux/srcutiny.h +++ b/include/linux/srcutiny.h @@ -64,7 +64,7 @@ static inline int __srcu_read_lock(struct srcu_struct *ssp) { int idx; - preempt_disable(); // Needed for PREEMPT_AUTO + preempt_disable(); // Needed for PREEMPT_LAZY idx = ((READ_ONCE(ssp->srcu_idx) + 1) & 0x2) >> 1; WRITE_ONCE(ssp->srcu_lock_nesting[idx], READ_ONCE(ssp->srcu_lock_nesting[idx]) + 1); preempt_enable(); diff --git a/kernel/rcu/Kconfig b/kernel/rcu/Kconfig index 2bb22dac3b5a9..582d461c9ab7d 100644 --- a/kernel/rcu/Kconfig +++ b/kernel/rcu/Kconfig @@ -91,7 +91,7 @@ config NEED_TASKS_RCU config TASKS_RCU bool - default NEED_TASKS_RCU && (PREEMPTION || PREEMPT_AUTO) + default NEED_TASKS_RCU && PREEMPTION select IRQ_WORK config FORCE_TASKS_RUDE_RCU diff --git a/kernel/rcu/srcutiny.c b/kernel/rcu/srcutiny.c index 4dcbf8aa80ff7..f688bdad293ed 100644 --- a/kernel/rcu/srcutiny.c +++ b/kernel/rcu/srcutiny.c @@ -98,7 +98,7 @@ void __srcu_read_unlock(struct srcu_struct *ssp, int idx) { int newval; - preempt_disable(); // Needed for PREEMPT_AUTO + preempt_disable(); // Needed for PREEMPT_LAZY newval = READ_ONCE(ssp->srcu_lock_nesting[idx]) - 1; WRITE_ONCE(ssp->srcu_lock_nesting[idx], newval); preempt_enable(); @@ -120,7 +120,7 @@ void srcu_drive_gp(struct work_struct *wp) struct srcu_struct *ssp; ssp = container_of(wp, struct srcu_struct, srcu_work); - preempt_disable(); // Needed for PREEMPT_AUTO + preempt_disable(); // Needed for PREEMPT_LAZY if (ssp->srcu_gp_running || ULONG_CMP_GE(ssp->srcu_idx, READ_ONCE(ssp->srcu_idx_max))) { preempt_enable(); return; /* Already running or nothing to do. */ @@ -138,7 +138,7 @@ void srcu_drive_gp(struct work_struct *wp) WRITE_ONCE(ssp->srcu_gp_waiting, true); /* srcu_read_unlock() wakes! */ preempt_enable(); swait_event_exclusive(ssp->srcu_wq, !READ_ONCE(ssp->srcu_lock_nesting[idx])); - preempt_disable(); // Needed for PREEMPT_AUTO + preempt_disable(); // Needed for PREEMPT_LAZY WRITE_ONCE(ssp->srcu_gp_waiting, false); /* srcu_read_unlock() cheap. */ WRITE_ONCE(ssp->srcu_idx, ssp->srcu_idx + 1); preempt_enable(); @@ -159,7 +159,7 @@ void srcu_drive_gp(struct work_struct *wp) * at interrupt level, but the ->srcu_gp_running checks will * straighten that out. */ - preempt_disable(); // Needed for PREEMPT_AUTO + preempt_disable(); // Needed for PREEMPT_LAZY WRITE_ONCE(ssp->srcu_gp_running, false); idx = ULONG_CMP_LT(ssp->srcu_idx, READ_ONCE(ssp->srcu_idx_max)); preempt_enable(); @@ -172,7 +172,7 @@ static void srcu_gp_start_if_needed(struct srcu_struct *ssp) { unsigned long cookie; - preempt_disable(); // Needed for PREEMPT_AUTO + preempt_disable(); // Needed for PREEMPT_LAZY cookie = get_state_synchronize_srcu(ssp); if (ULONG_CMP_GE(READ_ONCE(ssp->srcu_idx_max), cookie)) { preempt_enable(); @@ -199,7 +199,7 @@ void call_srcu(struct srcu_struct *ssp, struct rcu_head *rhp, rhp->func = func; rhp->next = NULL; - preempt_disable(); // Needed for PREEMPT_AUTO + preempt_disable(); // Needed for PREEMPT_LAZY local_irq_save(flags); *ssp->srcu_cb_tail = rhp; ssp->srcu_cb_tail = &rhp->next; @@ -261,7 +261,7 @@ unsigned long start_poll_synchronize_srcu(struct srcu_struct *ssp) { unsigned long ret; - preempt_disable(); // Needed for PREEMPT_AUTO + preempt_disable(); // Needed for PREEMPT_LAZY ret = get_state_synchronize_srcu(ssp); srcu_gp_start_if_needed(ssp); preempt_enable(); From patchwork Thu Jan 16 20:13:21 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Paul E. McKenney" X-Patchwork-Id: 13942200 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 F1DF422FACD; Thu, 16 Jan 2025 20:13: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=1737058410; cv=none; b=eoKVHMhBMCF0wbEJ4EY6mmK+zcrkbhcensWdrbRpDo1XuAdBkFr9hi+Y+VLx5eyZzG7fQTKBzegbCUD/5SIFomsrwLhj+3YmmA5XKSDAAC759SFxilAj0eneO+/XJxv2CcfCaF8vRQiLfQG+F2tSCFVlmNeClnpo2ilTFlRLDZM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737058410; c=relaxed/simple; bh=h7UaYb14hxuWlBGdYH1/6Ho7xR5oRrUYUhDJkEaVBH4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=PxiIA02Tn+XuxNKcQ6/jtccyf19J9txRVo05C3GH6h7MO7YSOwULikM2La4gYnXcpXHWRJNbQINbImKZGd2sadYSWKIxL4gucBxQCO06TRfruCXRac+I44kS5HOyg3xyihn51QUeA9dHAix93WtmYqNgCEVUuJwZvEFbp9BU+L4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=s+w/JRJh; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="s+w/JRJh" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9E945C4CEDD; Thu, 16 Jan 2025 20:13:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1737058409; bh=h7UaYb14hxuWlBGdYH1/6Ho7xR5oRrUYUhDJkEaVBH4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=s+w/JRJhEln/T2a1R34CUiY94csoGwVS7GAMoAKe7bxjKrwE7XmBoXgsdb00JL/vr WjinbS19FsBT/osxApckOUsBADtwu+Td1ok/FkYswuk0pPr+goIqkxKlPtK5TrsKyU dbsWoHkbAvJXb1iFeF7yglvlQe4+4mi572OBJYNeSgkVa/49k0dvXKbJLY7Doq5XIY 2tMdWh+DbfRVWQ+QKG3QDnC8uzVx6ciUXDA8ePACc7n088jZIirl/x1wBH+M38UsAm So+KWmNKV+rJzWgtoTFSJ5ccpycEgX3u9Hi2JIoi/ZD089CzJMg9LsVujoOov3onJT iudcOkXJgnuYA== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 4F1E8CE37B4; Thu, 16 Jan 2025 12:13:29 -0800 (PST) From: "Paul E. McKenney" To: rcu@vger.kernel.org Cc: linux-kernel@vger.kernel.org, kernel-team@meta.com, rostedt@goodmis.org, Ankur Arora , Frederic Weisbecker , "Paul E . McKenney" Subject: [PATCH rcu 3/9] sched: update __cond_resched comment about RCU quiescent states Date: Thu, 16 Jan 2025 12:13:21 -0800 Message-Id: <20250116201327.3782963-3-paulmck@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: rcu@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Ankur Arora Update comment in __cond_resched() clarifying how urgently needed quiescent state are provided. Signed-off-by: Ankur Arora Reviewed-by: Frederic Weisbecker Signed-off-by: Paul E. McKenney --- kernel/sched/core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 95e40895a5190..b0f7ffcc46a66 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -7281,7 +7281,7 @@ int __sched __cond_resched(void) return 1; } /* - * In preemptible kernels, ->rcu_read_lock_nesting tells the tick + * In PREEMPT_RCU kernels, ->rcu_read_lock_nesting tells the tick * whether the current CPU is in an RCU read-side critical section, * so the tick can report quiescent states even for CPUs looping * in kernel context. In contrast, in non-preemptible kernels, @@ -7290,6 +7290,8 @@ int __sched __cond_resched(void) * RCU quiescent state. Therefore, the following code causes * cond_resched() to report a quiescent state, but only when RCU * is in urgent need of one. + * A third case, preemptible, but non-PREEMPT_RCU provides for + * urgently needed quiescent states via rcu_flavor_sched_clock_irq(). */ #ifndef CONFIG_PREEMPT_RCU rcu_all_qs(); From patchwork Thu Jan 16 20:13:22 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Paul E. McKenney" X-Patchwork-Id: 13942202 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 150972361E9; Thu, 16 Jan 2025 20:13: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=1737058410; cv=none; b=muZbBTtw/RIbFDVVJ6mb0FX2bcfL/3VC+6pFg6MEhzvi4OZw9oaHsd0uLljmHIbCVszddjKZNBpD0BWTlRC1tajYI//z/k78K+JLcYAGxixww+OzaffKZXggadIXQDBHlNKgL+CET0ISKdh+RTiC87epndgQU0/8QB2nti0JkZs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737058410; c=relaxed/simple; bh=OQ+//3UxqY/Z/CdiyljxSlA3+2EpSvXeHCw/6tWExb4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=UYMAuC0g5GG6ReNHmJGt85RgKXk8gU5FjRQ27Q0WFfrhq42XLEBgn7l9DpXMs5vcuHkc0xXbEHV7oKvEPgISTgkOpXV/9FJIie4mSjVN0VMc4bLpailhZpXBRbGxTypMd1TKNy5aWuxdzrZUISnBauPs+n+F7HWTl3xTH9Vf4f0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=eLPs4plT; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="eLPs4plT" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B002DC4CEE3; Thu, 16 Jan 2025 20:13:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1737058409; bh=OQ+//3UxqY/Z/CdiyljxSlA3+2EpSvXeHCw/6tWExb4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eLPs4plTRkg8eu+2kqIolyU8l+bLwkWQ+gYmOpaLtrvfk/BnN297A+cCi9MuCCVDP 9mX4Iv4jZLtaWZ8BQED6HSjXHSy3hWg71hcNOxkJ+LgrJwTbquKpAPEryrHa1wsUgb PZGNgEhg36b2aIWDR+6IP949SoyK6xvg/q9ZIaJMmT/hQjC8lUuMiVu8rfvWQeIydi wEV4QSuxwYJyt9Hphl78libZ+qmLNdsNVCECs2vK3Gp2xeyCgh9pRgq1Cn2Jo43zf3 bMH1HdZzw8ERSge4juNqTpKZxRyDha2PJK1JgEDXbhwZ1grmJdq89KfQkG3vNAdLHr shB4XMUNkIogw== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 51B84CE37B6; Thu, 16 Jan 2025 12:13:29 -0800 (PST) From: "Paul E. McKenney" To: rcu@vger.kernel.org Cc: linux-kernel@vger.kernel.org, kernel-team@meta.com, rostedt@goodmis.org, Ankur Arora , Frederic Weisbecker , "Paul E . McKenney" Subject: [PATCH rcu 4/9] rcu: handle unstable rdp in rcu_read_unlock_strict() Date: Thu, 16 Jan 2025 12:13:22 -0800 Message-Id: <20250116201327.3782963-4-paulmck@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: rcu@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Ankur Arora rcu_read_unlock_strict() can be called with preemption enabled which can make for an unstable rdp and a racy norm value. Fix this by dropping the preempt-count in __rcu_read_unlock() after the call to rcu_read_unlock_strict(), adjusting the preempt-count check appropriately. Suggested-by: Frederic Weisbecker Signed-off-by: Ankur Arora Reviewed-by: Frederic Weisbecker Signed-off-by: Paul E. McKenney --- include/linux/rcupdate.h | 2 +- kernel/rcu/tree_plugin.h | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index c6c4aee47df2c..9b05db8ff0619 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h @@ -95,9 +95,9 @@ static inline void __rcu_read_lock(void) static inline void __rcu_read_unlock(void) { - preempt_enable(); if (IS_ENABLED(CONFIG_RCU_STRICT_GRACE_PERIOD)) rcu_read_unlock_strict(); + preempt_enable(); } static inline int rcu_preempt_depth(void) diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h index bb7ca6eb9ef04..b025e95ede053 100644 --- a/kernel/rcu/tree_plugin.h +++ b/kernel/rcu/tree_plugin.h @@ -833,8 +833,17 @@ void rcu_read_unlock_strict(void) { struct rcu_data *rdp; - if (irqs_disabled() || preempt_count() || !rcu_state.gp_kthread) + if (irqs_disabled() || in_atomic_preempt_off() || !rcu_state.gp_kthread) return; + + /* + * rcu_report_qs_rdp() can only be invoked with a stable rdp and + * from the local CPU. + * + * The in_atomic_preempt_off() check ensures that we come here holding + * the last preempt_count (which will get dropped once we return to + * __rcu_read_unlock(). + */ rdp = this_cpu_ptr(&rcu_data); rdp->cpu_no_qs.b.norm = false; rcu_report_qs_rdp(rdp); From patchwork Thu Jan 16 20:13:23 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Paul E. McKenney" X-Patchwork-Id: 13942203 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 150F8236A64; Thu, 16 Jan 2025 20:13: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=1737058410; cv=none; b=gnDWzYzaTyOo4xEONRIZULcb93gXKNzp9sFaz7fNS5xHkcQomK9yih+bkOARCGQo0iSA0hZ1kSSzzpsCw2eoumb2zK4aG9SoqxGxoEsME4dLP+lSnUo24Ew/Q/GCb6wEOmf48FZz/rkNdMcUC69UT5zzJMHkr6GEl9+gQMExh3U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737058410; c=relaxed/simple; bh=llFo4LYRbOuDKXW49Xlffc6rJzI12H86h8RHpABsdnc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=lXW5L4AsvRZUDNGg+3srDUlYciYocD+i71A+UNRrNPlLzIgQhVLKlaOwEkwR7n6Yfo7LRxMJM2+esO/Zey4nOwZZqkQBHmlyzN7qqs9BMPoFKhJvcncuYQmf2glo02U9E5PvhNjpED+2XCmA4HalhZ7/RssajaAh7x4zsxNznus= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=H/jbuhKC; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="H/jbuhKC" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B43B9C4CEE6; Thu, 16 Jan 2025 20:13:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1737058409; bh=llFo4LYRbOuDKXW49Xlffc6rJzI12H86h8RHpABsdnc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=H/jbuhKCNzxTuE04nNGyBL9b1VlsbRJ+6UlSoyh8f/Png73slw3dJfiIssubp5H0s m7Stq3zqmrpZuGx+oXXyCHuL3nsLYTI/dfldiipywH16yLYTIvb8115RE/+j93P01d LLqnSv03/uPzAZF3eYlwm1lEjX+TnpKADTKTU2Se6d1faA3ahIgJi4RrFaoIStr8O6 vqwDfjeDXcd7Y9uslYwCuqflQLxk0SrT1Gtd/mwmbk4FLGmmSwLr34XZOCPrscyN9M K6SflJYxu+kCQCdCobSPSVC1gZNKlmmE4tGfAyZTEDNEZQKNGhRfzmcPF55BdEKOPp 9+iNBnEjcTQHg== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 54015CE37C1; Thu, 16 Jan 2025 12:13:29 -0800 (PST) From: "Paul E. McKenney" To: rcu@vger.kernel.org Cc: linux-kernel@vger.kernel.org, kernel-team@meta.com, rostedt@goodmis.org, Ankur Arora , "Paul E . McKenney" , Sebastian Andrzej Siewior , Frederic Weisbecker Subject: [PATCH rcu 5/9] rcu: handle quiescent states for PREEMPT_RCU=n, PREEMPT_COUNT=y Date: Thu, 16 Jan 2025 12:13:23 -0800 Message-Id: <20250116201327.3782963-5-paulmck@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: rcu@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Ankur Arora With PREEMPT_RCU=n, cond_resched() provides urgently needed quiescent states for read-side critical sections via rcu_all_qs(). One reason why this was needed: lacking preempt-count, the tick handler has no way of knowing whether it is executing in a read-side critical section or not. With (PREEMPT_LAZY=y, PREEMPT_DYNAMIC=n), we get (PREEMPT_COUNT=y, PREEMPT_RCU=n). In this configuration cond_resched() is a stub and does not provide quiescent states via rcu_all_qs(). (PREEMPT_RCU=y provides this information via rcu_read_unlock() and its nesting counter.) So, use the availability of preempt_count() to report quiescent states in rcu_flavor_sched_clock_irq(). Suggested-by: Paul E. McKenney Reviewed-by: Sebastian Andrzej Siewior Signed-off-by: Ankur Arora Reviewed-by: Frederic Weisbecker Signed-off-by: Paul E. McKenney --- kernel/rcu/tree_plugin.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h index b025e95ede053..f444e8d3f68b4 100644 --- a/kernel/rcu/tree_plugin.h +++ b/kernel/rcu/tree_plugin.h @@ -984,13 +984,16 @@ static void rcu_preempt_check_blocked_tasks(struct rcu_node *rnp) */ static void rcu_flavor_sched_clock_irq(int user) { - if (user || rcu_is_cpu_rrupt_from_idle()) { + if (user || rcu_is_cpu_rrupt_from_idle() || + (IS_ENABLED(CONFIG_PREEMPT_COUNT) && + (preempt_count() == HARDIRQ_OFFSET))) { /* * Get here if this CPU took its interrupt from user - * mode or from the idle loop, and if this is not a - * nested interrupt. In this case, the CPU is in - * a quiescent state, so note it. + * mode, from the idle loop without this being a nested + * interrupt, or while not holding the task preempt count + * (with PREEMPT_COUNT=y). In this case, the CPU is in a + * quiescent state, so note it. * * No memory barrier is required here because rcu_qs() * references only CPU-local variables that other CPUs From patchwork Thu Jan 16 20:13:24 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Paul E. McKenney" X-Patchwork-Id: 13942204 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 2D8E423F296; Thu, 16 Jan 2025 20:13:30 +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=1737058410; cv=none; b=Djy6E/OhGNxbtuWGgoTjDj3nsoO81Fb1YBONmXHODgOecT81VVWQEWRALZrhQLhL3iVeVARospEguV6NMdCgRYCfKQCKC+6ESqzE94v2zNDnUdbTiqsVJI20t9mesk9EwHe0AUcxqFYIa1+Oo/+CPTVPNrmduJuObB8Vs2WmLFA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737058410; c=relaxed/simple; bh=M4IGtN6BovqfzK1PpNFL5ipM2kvkjsr8kEJp1L/pIXs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=RXdKTUMol711RxUvTz3msdosUKhEFmgZtJK3l7GTD6laVEsCsQIYVnC2JLo/eYj/jlajA2/5dyvzlxGQcaoQs9CuL8D0tB6Jl8wgdplbd3l2qSCOYPjJTqbymZN47gpg0Ytejrq7TZA9YNQlZPgBQN1eIQdKWSHV1q6vpxU55NA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=SPAYcHkf; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="SPAYcHkf" Received: by smtp.kernel.org (Postfix) with ESMTPSA id F2131C4CEEF; Thu, 16 Jan 2025 20:13:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1737058410; bh=M4IGtN6BovqfzK1PpNFL5ipM2kvkjsr8kEJp1L/pIXs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SPAYcHkfxm/X2v7LZoMJJKYg/Vdv63ooxeCgB1MtkhTw2sQ3K61ui0TqoBbhHIILx H0rpssxf8zAaW45W5m7OIMDFmHix5pXaB2zrBqckox6VhkcsmvoPNthXJN55vT9kDM 1OMa2YG20u6pPfG0n9aTu/sWfS15l9mx9LEHnXEBpNUZ4Kd9fH6dDM3S1Z0QZNf+Dx 8fpbA1DWzfFlsbpvz2P8paLb06aQDmAgvWwcBwX7c30XAbhm/XUN8IssKocV48h38h JJYgrPUA3jYzNYEjgosQvgCdb75vPo50B9oHRvyQUMgEP5SjGph76ZD0xZugn2wCWi loUpiAJmWPUMw== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 56556CE37C4; Thu, 16 Jan 2025 12:13:29 -0800 (PST) From: "Paul E. McKenney" To: rcu@vger.kernel.org Cc: linux-kernel@vger.kernel.org, kernel-team@meta.com, rostedt@goodmis.org, Ankur Arora , "Paul E . McKenney" , Daniel Bristot de Oliveira , Frederic Weisbecker Subject: [PATCH rcu 6/9] osnoise: provide quiescent states Date: Thu, 16 Jan 2025 12:13:24 -0800 Message-Id: <20250116201327.3782963-6-paulmck@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: rcu@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Ankur Arora To reduce RCU noise for nohz_full configurations, osnoise depends on cond_resched() providing quiescent states for PREEMPT_RCU=n configurations. For PREEMPT_RCU=y configurations -- where cond_resched() is a stub -- we do this by directly calling rcu_momentary_eqs(). With (PREEMPT_LAZY=y, PREEMPT_DYNAMIC=n), however, we have a configuration with (PREEMPTION=y, PREEMPT_RCU=n) where neither of the above can help. Handle that by providing an explicit quiescent state here for all configurations. As mentioned above this is not needed for non-stubbed cond_resched(), but, providing a quiescent state here just pulls in one that a future cond_resched() would provide, so doesn't cause any extra work for this configuration. Cc: Paul E. McKenney Cc: Daniel Bristot de Oliveira Cc: Steven Rostedt Suggested-by: Paul E. McKenney Acked-by: Daniel Bristot de Oliveira Signed-off-by: Ankur Arora Reviewed-by: Frederic Weisbecker Signed-off-by: Paul E. McKenney --- kernel/trace/trace_osnoise.c | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/kernel/trace/trace_osnoise.c b/kernel/trace/trace_osnoise.c index b9f96c77527db..2340ffcefb9d1 100644 --- a/kernel/trace/trace_osnoise.c +++ b/kernel/trace/trace_osnoise.c @@ -1531,27 +1531,25 @@ static int run_osnoise(void) /* * In some cases, notably when running on a nohz_full CPU with - * a stopped tick PREEMPT_RCU has no way to account for QSs. - * This will eventually cause unwarranted noise as PREEMPT_RCU - * will force preemption as the means of ending the current - * grace period. We avoid this problem by calling - * rcu_momentary_eqs(), which performs a zero duration - * EQS allowing PREEMPT_RCU to end the current grace period. - * This call shouldn't be wrapped inside an RCU critical - * section. + * a stopped tick PREEMPT_RCU or PREEMPT_LAZY have no way to + * account for QSs. This will eventually cause unwarranted + * noise as RCU forces preemption as the means of ending the + * current grace period. We avoid this by calling + * rcu_momentary_eqs(), which performs a zero duration EQS + * allowing RCU to end the current grace period. This call + * shouldn't be wrapped inside an RCU critical section. * - * Note that in non PREEMPT_RCU kernels QSs are handled through - * cond_resched() + * Normally QSs for other cases are handled through cond_resched(). + * For simplicity, however, we call rcu_momentary_eqs() for all + * configurations here. */ - if (IS_ENABLED(CONFIG_PREEMPT_RCU)) { - if (!disable_irq) - local_irq_disable(); + if (!disable_irq) + local_irq_disable(); - rcu_momentary_eqs(); + rcu_momentary_eqs(); - if (!disable_irq) - local_irq_enable(); - } + if (!disable_irq) + local_irq_enable(); /* * For the non-preemptive kernel config: let threads runs, if From patchwork Thu Jan 16 20:13:25 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Paul E. McKenney" X-Patchwork-Id: 13942207 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 5266524168F; Thu, 16 Jan 2025 20:13:30 +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=1737058410; cv=none; b=mDTv8hnD3XhK9CAFz6fo5/CPEsURbdpysFJcfRMefsRH4nSycDDZwQq+vNNRDQ9ObXD/7ljq8Mxp4GPN/eiahaMdP6RNM0P4ykNlQvbbRpO04+wilwvGNBDmmYJ3K2vKJ5CNQa9IZyRt8psXfvbEQWK8CN3WAPdnsdK18PoM3oM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737058410; c=relaxed/simple; bh=lS+VTDHcbfCovgK+C4MkX0AzlheKwnhQP7lt1rpOa24=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=EvY7/rvz8sMrp4irA6C8Us0vwybUW6FM0266Vz9IvTXj9ilWviK8d1XP0EnxIK0c5+e6ntwtzvA+/C6m0L0xxWhMeY1XH5wezRKC/G3d5lW5zqIEXbvYAOQx2Lzl/NR4FkvttzQ0l0cGn5fphHqE/WoDhlfqm4IBU1nGt+M9b8Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=qlyVQmqX; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="qlyVQmqX" Received: by smtp.kernel.org (Postfix) with ESMTPSA id F2014C4CEED; Thu, 16 Jan 2025 20:13:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1737058410; bh=lS+VTDHcbfCovgK+C4MkX0AzlheKwnhQP7lt1rpOa24=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qlyVQmqXWLVaTShp182BCOGEchEohIk9t+FBGtunkHsq23zfdJBkd5sOnHIrQfkXY nIRlK5MMzls9rxRj7vvxriEokb2HVL+mUCdC/SIz/3CIIIEoq9jSD7kf8l4prWc+sh DLuSPoRDJpyaNXltrjon3VBiKyNAuo/aY9W1XCzKOHvYugb2tgK9bJcghmCjPYV2bB N/q8j13/L+z0kNLM8YIRoJ7l400dLpU6i9WxSMzuqVB5tIhcsFqcSDFlhWRq1uUe5p mcK/+Xdn+0FPebQlx49Z12JAKezIiHFHa+9bO9qIj1/DMe/lBtO48Tqn+EJxNdoSF1 pQLNjSbHzfjiQ== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 58BD8CE37D2; Thu, 16 Jan 2025 12:13:29 -0800 (PST) From: "Paul E. McKenney" To: rcu@vger.kernel.org Cc: linux-kernel@vger.kernel.org, kernel-team@meta.com, rostedt@goodmis.org, Ankur Arora , "Paul E . McKenney" , Peter Zijlstra , Frederic Weisbecker Subject: [PATCH rcu 7/9] rcu: limit PREEMPT_RCU configurations Date: Thu, 16 Jan 2025 12:13:25 -0800 Message-Id: <20250116201327.3782963-7-paulmck@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: rcu@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Ankur Arora PREEMPT_LAZY can be enabled stand-alone or alongside PREEMPT_DYNAMIC which allows for dynamic switching of preemption models. The choice of PREEMPT_RCU or not, however, is fixed at compile time. Given that PREEMPT_RCU makes some trade-offs to optimize for latency as opposed to throughput, configurations with limited preemption might prefer the stronger forward-progress guarantees of PREEMPT_RCU=n. Accordingly, explicitly limit PREEMPT_RCU=y to the latency oriented preemption models: PREEMPT, PREEMPT_RT, and the runtime configurable model PREEMPT_DYNAMIC. This means the throughput oriented models, PREEMPT_NONE, PREEMPT_VOLUNTARY, and PREEMPT_LAZY will run with PREEMPT_RCU=n. Cc: Paul E. McKenney Cc: Peter Zijlstra Reviewed-by: Frederic Weisbecker Signed-off-by: Ankur Arora Signed-off-by: Paul E. McKenney --- kernel/rcu/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/rcu/Kconfig b/kernel/rcu/Kconfig index 582d461c9ab7d..80242957fa417 100644 --- a/kernel/rcu/Kconfig +++ b/kernel/rcu/Kconfig @@ -18,7 +18,7 @@ config TREE_RCU config PREEMPT_RCU bool - default y if PREEMPTION + default y if (PREEMPT || PREEMPT_RT || PREEMPT_DYNAMIC) select TREE_RCU help This option selects the RCU implementation that is From patchwork Thu Jan 16 20:13:26 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Paul E. McKenney" X-Patchwork-Id: 13942206 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 52603241688; Thu, 16 Jan 2025 20:13:30 +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=1737058410; cv=none; b=MRH9glhl/VD3JSMHNIj3tlsUL4ila0nkSwWAaDEGhv/nTkJV0OkLdkNUXrFtjgiKJajxWZkSJSRX97Bq1gaEofpr2w5yTQPyrbEQ5eG9Zk53r6CSp97tZmr35mt3XIzj5BA4mzfgT6OQMfznuB1OB9me6Q3zwj8TptqcBy8xavw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737058410; c=relaxed/simple; bh=bU/hhG2oOe2+9IgwUDcxuAMUF+jz8ZnfcJS4yxVb3jU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=ADyqGzaSBjWp1TXvDiYfm/KSwHQaKCy9X+bmou7XWd//+ZgxIpJ/+wKkSqFOd9QLWF+HcKP5AoB21B6BjNHYNF5lgWr1wvFiqDeJeRqouRZUCQEYX2wBx9ulNR1sCATW0vkY6YVFcr+MNLl/nD4DDjmLpr76MK3DSkEXZlmn9jI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=qZLX9bgS; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="qZLX9bgS" Received: by smtp.kernel.org (Postfix) with ESMTPSA id F221AC4AF09; Thu, 16 Jan 2025 20:13:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1737058410; bh=bU/hhG2oOe2+9IgwUDcxuAMUF+jz8ZnfcJS4yxVb3jU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qZLX9bgSoOu8vGiAJoWwBwjlhwPJhKBnhfXKWmeNKIx7C+5fjB+STYYbAkLKzciAy cR0rOb1ru/ebaTDQkNQrwapLgSyevY2/+o2yFZKHPu8Xfe5+dkILzyKnxK5aMoBFYP x+gtLKCDWCsgl7G97jpicY34eqWRFcL0H9vxiWmV13LjHOJIoSDFXxBwQT8HgAp9rt WhzmULtHuMBBy3+zpNWW732nj1+4OQ15S+7ta9be/mpilAjPzJyE80/iq0bxIHxzOQ i3u1xj6KT0PAWubzn7zNFtEZvyY9WEpD0LNLbTR29+YRVYrkyGxYk7Z4iZvflR9cvD SO/flYMjwd6Yw== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 5AEAECE37D4; Thu, 16 Jan 2025 12:13:29 -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" Subject: [PATCH rcu 8/9] rcutorture: Make scenario TREE10 build CONFIG_PREEMPT_LAZY=y Date: Thu, 16 Jan 2025 12:13:26 -0800 Message-Id: <20250116201327.3782963-8-paulmck@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: rcu@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 This commit tests lazy preemption by causing the TREE10 rcutorture scenario to build its kernel with CONFIG_PREEMPT_LAZY=y. Signed-off-by: Paul E. McKenney --- tools/testing/selftests/rcutorture/configs/rcu/TREE10 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/rcutorture/configs/rcu/TREE10 b/tools/testing/selftests/rcutorture/configs/rcu/TREE10 index 759ee51d3ddc6..420632b030dc4 100644 --- a/tools/testing/selftests/rcutorture/configs/rcu/TREE10 +++ b/tools/testing/selftests/rcutorture/configs/rcu/TREE10 @@ -1,6 +1,7 @@ CONFIG_SMP=y CONFIG_NR_CPUS=74 -CONFIG_PREEMPT_NONE=y +CONFIG_PREEMPT_NONE=n +CONFIG_PREEMPT_LAZY=y CONFIG_PREEMPT_VOLUNTARY=n CONFIG_PREEMPT=n CONFIG_PREEMPT_DYNAMIC=n From patchwork Thu Jan 16 20:13:27 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Paul E. McKenney" X-Patchwork-Id: 13942205 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 41F44241680; Thu, 16 Jan 2025 20:13:30 +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=1737058410; cv=none; b=ND4ClZZomIsrgn7Q3JnrqS8eY4zb9VbgsjXWJkzy1/MSK1nOYsth+Qi4P71VwhkJ6dy/YztEzcTZhnd9CHL3vaQNaAsEKJNJVG0YuCCuOfw8DtbsOyECQ4jT1zJsjZu+KGFiN+TtRaG+oD7qeWtM1aOQPqJteSekvr2+EhEFBIw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737058410; c=relaxed/simple; bh=6K2n88jSY1dRa7H83fEj4TajoHN1TN4hN0V+oa51GqE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=TU2nhZGLVvjcJaBbVDpZ7lgyozDrLKYhD4anFzONWgv7dCIuwfBAC2OkI22Vktny//aIunWuMvZzuc559sV48TgF7UCiRm7DhRTGL9qyTR5VcUbY3v80MQeh+X23O8ig+iM2tofKAFiCKGj4DeJcj9Rrkwx9jU6XyepNy5mPbnI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=dkjmx9UL; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="dkjmx9UL" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 10E2FC4CEE4; Thu, 16 Jan 2025 20:13:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1737058410; bh=6K2n88jSY1dRa7H83fEj4TajoHN1TN4hN0V+oa51GqE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dkjmx9UL0q44XOJSDreLQhC1n1vAOGbjwNGzUIPU1OoB2u61uoRzKBc/sohtbqMpr U7qWml/rFh65VQIrKmVbBnTxYwNYMA474TIPkZSX0gEGLWlEfkNnv1NZcujorqXyDV NWeU2PIFy1sfCeE6UX+i2siqmszHERc+5tOTZ6jKPW2ZHtQ/NpE106axffTDROL9n/ s0tGim2lXs5e7oJTcncyCTlzDgnNQ1QImoXgzeMEONjbnij2w0zU1+XtyyG0yjmOuh 8528oc7PjC69mZgPINMI6norXZKRHI7KE1oJYJ386WB1RKoNvJ46Lf+jqPJXJOlK0R SU/2eYUDx6aaA== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 5D0E0CE37D5; Thu, 16 Jan 2025 12:13:29 -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" Subject: [PATCH rcu 9/9] rcutorture: Make scenario TREE07 build CONFIG_PREEMPT_LAZY=y Date: Thu, 16 Jan 2025 12:13:27 -0800 Message-Id: <20250116201327.3782963-9-paulmck@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: rcu@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 This commit tests lazy preemption by causing the TREE07 rcutorture scenario to build its kernel with CONFIG_PREEMPT_LAZY=y. Signed-off-by: Paul E. McKenney --- tools/testing/selftests/rcutorture/configs/rcu/TREE07 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/rcutorture/configs/rcu/TREE07 b/tools/testing/selftests/rcutorture/configs/rcu/TREE07 index d30922d8c8832..352393bc5c566 100644 --- a/tools/testing/selftests/rcutorture/configs/rcu/TREE07 +++ b/tools/testing/selftests/rcutorture/configs/rcu/TREE07 @@ -1,7 +1,8 @@ CONFIG_SMP=y CONFIG_NR_CPUS=16 -CONFIG_PREEMPT_NONE=y +CONFIG_PREEMPT_NONE=n CONFIG_PREEMPT_VOLUNTARY=n +CONFIG_PREEMPT_LAZY=y CONFIG_PREEMPT=n CONFIG_PREEMPT_DYNAMIC=n #CHECK#CONFIG_TREE_RCU=y