rcu: Add multiple in-flight batches of kfree_rcu() work
authorJoel Fernandes (Google) <joel@joelfernandes.org>
Thu, 19 Sep 2019 21:58:26 +0000 (14:58 -0700)
committerPaul E. McKenney <paulmck@kernel.org>
Fri, 24 Jan 2020 18:24:31 +0000 (10:24 -0800)
commit0392bebebf26f09434e6c7ca4c09c014efeef76a
treee65b6f9582a89c130c143657bd42447315b35010
parent569d767087ef56a59bc2d1d5f25ee447eeae442a
rcu: Add multiple in-flight batches of kfree_rcu() work

During testing, it was observed that amount of memory consumed due
kfree_rcu() batching is 300-400MB. Previously we had only a single
head_free pointer pointing to the list of rcu_head(s) that are to be
freed after a grace period. Until this list is drained, we cannot queue
any more objects on it since such objects may not be ready to be
reclaimed when the worker thread eventually gets to drainin g the
head_free list.

We can do better by maintaining multiple lists as done by this patch.
Testing shows that memory consumption came down by around 100-150MB with
just adding another list. Adding more than 1 additional list did not
show any improvement.

Suggested-by: Paul E. McKenney <paulmck@linux.ibm.com>
Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
[ paulmck: Code style and initialization handling. ]
[ paulmck: Fix field name, reported by kbuild test robot <lkp@intel.com>. ]
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
kernel/rcu/tree.c