mbox series

[0/9] rcu: Support for lazy callbacks on !CONFIG_RCU_NOCB_CPU

Message ID 20230531101736.12981-1-frederic@kernel.org (mailing list archive)
Headers show
Series rcu: Support for lazy callbacks on !CONFIG_RCU_NOCB_CPU | expand

Message

Frederic Weisbecker May 31, 2023, 10:17 a.m. UTC
Hi,

Here is a first attempt at providing support for lazy callbacks on
non-offloaded CPUs. I have measured interesting results on my machine
when it is mostly idle (just an idle ssh connection kept alive) with
a gain of +10% idle time. This needs more serious testing though,
especially to make sure that no performance regression is introduced.

Also I have only mildly tested on NOCB (eg: no rcutorture yet), so I
might have broken something.

Finally it's also possible that the idle time improvement is due to me
introducing a bug :)

The patches 1-5 can be considered independently from the rest.

Frederic Weisbecker (9):
  rcu: Assume IRQS disabled from rcu_report_dead()
  rcu: Use rcu_segcblist_segempty() instead of open coding it
  rcu: Rename jiffies_till_flush to jiffies_lazy_flush
  rcu: Introduce lazy queue's own qhimark
  rcu: Add rcutree.lazy_enabled boot parameter
  rcu/nocb: Rename was_alldone to was_pending
  rcu: Implement lazyness on the main segcblist level
  rcu: Make segcblist flags test strict
  rcu: Support lazy callbacks with CONFIG_RCU_NOCB=n

 .../admin-guide/kernel-parameters.txt         |   5 +
 include/linux/rcu_segcblist.h                 |  13 +-
 kernel/rcu/Kconfig                            |   2 +-
 kernel/rcu/rcu.h                              |   8 +-
 kernel/rcu/rcu_segcblist.c                    |  44 ++-
 kernel/rcu/rcu_segcblist.h                    |  32 +-
 kernel/rcu/rcuscale.c                         |   6 +-
 kernel/rcu/tree.c                             | 272 +++++++++++++++--
 kernel/rcu/tree.h                             |   9 +-
 kernel/rcu/tree_nocb.h                        | 285 +++++-------------
 10 files changed, 425 insertions(+), 251 deletions(-)

Comments

Frederic Weisbecker July 5, 2023, 12:41 p.m. UTC | #1
Le Wed, May 31, 2023 at 12:17:27PM +0200, Frederic Weisbecker a écrit :
> Hi,
> 
> Here is a first attempt at providing support for lazy callbacks on
> non-offloaded CPUs. I have measured interesting results on my machine
> when it is mostly idle (just an idle ssh connection kept alive) with
> a gain of +10% idle time. This needs more serious testing though,
> especially to make sure that no performance regression is introduced.

So after refining my measurements, it actually doesn't seem to bring
much.

Here's what I measured (it's an average after 100 runs):

* 0.01% more idle time during a "sleep 10"
* introduce 3% performance regression during an "scp" on the tools directory
  of the kernel source.
* Brings less than 1% performance improvement with a "make" on tools/perf

It only brings unconditional improvement when rcu boost is enabled (callbacks
offloaded to rcuc) but still below 1%.

The reason for the performance penalty is unclear, I initially thought it
was due to the batch execution delaying other softirqs vectors but it doesn't
look that way after all.

So for now I'm only going to re-iterate the cleanups in the beginning
of the patchset and I'll wait for a good reason before ever proceeding with the
rest.

Thanks.