[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230406001238.647536-1-qiang1.zhang@intel.com>
Date: Thu, 6 Apr 2023 08:12:38 +0800
From: Zqiang <qiang1.zhang@...el.com>
To: urezki@...il.com, paulmck@...nel.org, frederic@...nel.org,
joel@...lfernandes.org, qiang1.zhang@...el.com
Cc: qiang.zhang1211@...il.com, rcu@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH v2] rcu/kvfree: Prevents cache growing when the backoff_page_cache_fill is set
Currently, in kfree_rcu_shrink_scan(), the drain_page_cache() is
executed before kfree_rcu_monitor() to drain page cache, if the bnode
structure's->gp_snap has done, the kvfree_rcu_bulk() will fill the
page cache again in kfree_rcu_monitor(), this commit add a check
for krcp structure's->backoff_page_cache_fill in put_cached_bnode(),
if the krcp structure's->backoff_page_cache_fill is set, prevent page
cache growing.
Signed-off-by: Zqiang <qiang1.zhang@...el.com>
---
kernel/rcu/tree.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index 9cc0a7766fd2..f25430ae1936 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -2907,6 +2907,8 @@ static inline bool
put_cached_bnode(struct kfree_rcu_cpu *krcp,
struct kvfree_rcu_bulk_data *bnode)
{
+ if (atomic_read(&krcp->backoff_page_cache_fill))
+ return false;
// Check the limit.
if (krcp->nr_bkv_objs >= rcu_min_cached_objs)
return false;
--
2.32.0
Powered by blists - more mailing lists