rcu/kvfree: Split ready for reclaim objects from a batch
authorUladzislau Rezki (Sony) <urezki@gmail.com>
Wed, 14 Dec 2022 12:06:30 +0000 (13:06 +0100)
committerPaul E. McKenney <paulmck@kernel.org>
Wed, 4 Jan 2023 01:48:41 +0000 (17:48 -0800)
commit2ca836b1da1777c75b7363a7ca2973e8ab11fc21
tree7d695f36968d81f1c45b9eea84ba491ac68b36e7
parent4c33464ae85e59cba3f8048a34d571edf229823a
rcu/kvfree: Split ready for reclaim objects from a batch

This patch splits the lists of objects so as to avoid sending any
through RCU that have already been queued for more than one grace
period.  These long-term-resident objects are immediately freed.
The remaining short-term-resident objects are queued for later freeing
using queue_rcu_work().

This change avoids delaying workqueue handlers with synchronize_rcu()
invocations.  Yes, workqueue handlers are designed to handle blocking,
but avoiding blocking when unnecessary improves performance during
low-memory situations.

Signed-off-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
kernel/rcu/tree.c