rcu-tasks: Treat only synchronous grace periods urgently
authorPaul E. McKenney <paulmck@kernel.org>
Mon, 15 May 2023 01:06:12 +0000 (18:06 -0700)
committerPaul E. McKenney <paulmck@kernel.org>
Fri, 14 Jul 2023 22:00:11 +0000 (15:00 -0700)
commitd119357d0743548f90243315de905cf6a79e5221
tree5dca5bcb34df7df9aa171a8212609cfd3c1c2b4f
parent06c2afb862f9da8dc5efa4b6076a0e48c3fbaaa5
rcu-tasks: Treat only synchronous grace periods urgently

The performance requirements on RCU Tasks, and in particular on RCU
Tasks Trace, have evolved over time as the workloads have evolved.
The current implementation is designed to provide low grace-period
latencies, and also to accommodate short-duration floods of callbacks.

However, current workloads can also provide a constant background
callback-queuing rate of a few hundred call_rcu_tasks_trace() invocations
per second.  This results in continuous back-to-back RCU Tasks Trace
grace periods, which in turn can consume the better part of 10% of a CPU.
One could take the attitude that there are several tens of other CPUs on
the systems running such workloads, but energy efficiency is a thing.
On these systems, although asynchronous grace-period requests happen
every few milliseconds, synchronous grace-period requests are quite rare.

This commit therefore arrranges for grace periods to be initiated
immediately in response to calls to synchronize_rcu_tasks*() and
also to calls to synchronize_rcu_mult() that are passed one of the
call_rcu_tasks*() functions.  These are recognized by the tell-tale
wakeme_after_rcu callback function.

In other cases, callbacks are gathered up for up to about 250 milliseconds
before a grace period is initiated.  This results in more than an order of
magnitude reduction in RCU Tasks Trace grace periods, with corresponding
reduction in consumption of CPU time.

Reported-by: Alexei Starovoitov <ast@kernel.org>
Reported-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
kernel/rcu/tasks.h
This page took 0.052121 seconds and 4 git commands to generate.