public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH rcu 0/1] RCU fixes for v6.12
@ 2024-08-16  7:10 Neeraj Upadhyay
  2024-08-16  7:11 ` [PATCH rcu] rcu: Use system_unbound_wq to avoid disturbing isolated CPUs neeraj.upadhyay
  0 siblings, 1 reply; 2+ messages in thread
From: Neeraj Upadhyay @ 2024-08-16  7:10 UTC (permalink / raw)
  To: rcu
  Cc: paulmck, joel, frederic, boqun.feng, urezki, linux-kernel,
	kernel-team, rostedt, longman

Hello,

Below are the RCU fixes for v6.12:

1.      Use system_unbound_wq to avoid disturbing isolated CPUs, courtesy
        of Waiman Long.


Git tree: https://git.kernel.org/pub/scm/linux/kernel/git/neeraj.upadhyay/linux-rcu.git/log/?h=fixes.12.08.24a


- Neeraj

------------------------------------------------------------------------

 kernel/rcu/tree.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH rcu] rcu: Use system_unbound_wq to avoid disturbing isolated CPUs
  2024-08-16  7:10 [PATCH rcu 0/1] RCU fixes for v6.12 Neeraj Upadhyay
@ 2024-08-16  7:11 ` neeraj.upadhyay
  0 siblings, 0 replies; 2+ messages in thread
From: neeraj.upadhyay @ 2024-08-16  7:11 UTC (permalink / raw)
  To: rcu
  Cc: linux-kernel, kernel-team, rostedt, paulmck, neeraj.upadhyay,
	neeraj.upadhyay, boqun.feng, joel, urezki, frederic, Waiman Long,
	Vratislav Bendel, Breno Leitao

From: Waiman Long <longman@redhat.com>

It was discovered that isolated CPUs could sometimes be disturbed by
kworkers processing kfree_rcu() works causing higher than expected
latency. It is because the RCU core uses "system_wq" which doesn't have
the WQ_UNBOUND flag to handle all its work items. Fix this violation of
latency limits by using "system_unbound_wq" in the RCU core instead.
This will ensure that those work items will not be run on CPUs marked
as isolated.

Beside the WQ_UNBOUND flag, the other major difference between system_wq
and system_unbound_wq is their max_active count. The system_unbound_wq
has a max_active of WQ_MAX_ACTIVE (512) while system_wq's max_active
is WQ_DFL_ACTIVE (256) which is half of WQ_MAX_ACTIVE.

Reported-by: Vratislav Bendel <vbendel@redhat.com>
Closes: https://issues.redhat.com/browse/RHEL-50220
Signed-off-by: Waiman Long <longman@redhat.com>
Reviewed-by: "Uladzislau Rezki (Sony)" <urezki@gmail.com>
Tested-by: Breno Leitao <leitao@debian.org>
Signed-off-by: Neeraj Upadhyay <neeraj.upadhyay@kernel.org>
---
 kernel/rcu/tree.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index e641cc681901..494aa9513d0b 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -3539,10 +3539,10 @@ schedule_delayed_monitor_work(struct kfree_rcu_cpu *krcp)
 	if (delayed_work_pending(&krcp->monitor_work)) {
 		delay_left = krcp->monitor_work.timer.expires - jiffies;
 		if (delay < delay_left)
-			mod_delayed_work(system_wq, &krcp->monitor_work, delay);
+			mod_delayed_work(system_unbound_wq, &krcp->monitor_work, delay);
 		return;
 	}
-	queue_delayed_work(system_wq, &krcp->monitor_work, delay);
+	queue_delayed_work(system_unbound_wq, &krcp->monitor_work, delay);
 }
 
 static void
@@ -3634,7 +3634,7 @@ static void kfree_rcu_monitor(struct work_struct *work)
 			// be that the work is in the pending state when
 			// channels have been detached following by each
 			// other.
-			queue_rcu_work(system_wq, &krwp->rcu_work);
+			queue_rcu_work(system_unbound_wq, &krwp->rcu_work);
 		}
 	}
 
@@ -3704,7 +3704,7 @@ run_page_cache_worker(struct kfree_rcu_cpu *krcp)
 	if (rcu_scheduler_active == RCU_SCHEDULER_RUNNING &&
 			!atomic_xchg(&krcp->work_in_progress, 1)) {
 		if (atomic_read(&krcp->backoff_page_cache_fill)) {
-			queue_delayed_work(system_wq,
+			queue_delayed_work(system_unbound_wq,
 				&krcp->page_cache_work,
 					msecs_to_jiffies(rcu_delay_page_cache_fill_msec));
 		} else {
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-08-16  7:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-16  7:10 [PATCH rcu 0/1] RCU fixes for v6.12 Neeraj Upadhyay
2024-08-16  7:11 ` [PATCH rcu] rcu: Use system_unbound_wq to avoid disturbing isolated CPUs neeraj.upadhyay

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox