rcu/kvfree: Make drain_page_cache() take early return if cache is disabled
authorZqiang <qiang1.zhang@intel.com>
Tue, 18 Apr 2023 12:27:02 +0000 (20:27 +0800)
committerPaul E. McKenney <paulmck@kernel.org>
Wed, 10 May 2023 00:26:21 +0000 (17:26 -0700)
commit6b706e5603c44ff0b6f43c2e26e0d590e1d265f8
tree41a0f568dd67dda72a570b1bcaca139635e80dba
parent60888b77a06ea16665e4df980bb86b418253e268
rcu/kvfree: Make drain_page_cache() take early return if cache is disabled

If the rcutree.rcu_min_cached_objs kernel boot parameter is set to zero,
then krcp->page_cache_work will never be triggered to fill page cache.
In addition, the put_cached_bnode() will not fill page cache.  As a
result krcp->bkvcache will always be empty, so there is no need to acquire
krcp->lock to get page from krcp->bkvcache.  This commit therefore makes
drain_page_cache() return immediately if the rcu_min_cached_objs is zero.

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