rcu.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] rcu/kvfree: Prevents cache growing when the backoff_page_cache_fill is set
@ 2023-04-06  0:12 Zqiang
  2023-04-06  4:37 ` Uladzislau Rezki
  0 siblings, 1 reply; 13+ messages in thread
From: Zqiang @ 2023-04-06  0:12 UTC (permalink / raw)
  To: urezki, paulmck, frederic, joel, qiang1.zhang
  Cc: qiang.zhang1211, rcu, linux-kernel

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@intel.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


^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2023-04-12 13:18 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-06  0:12 [PATCH v2] rcu/kvfree: Prevents cache growing when the backoff_page_cache_fill is set Zqiang
2023-04-06  4:37 ` Uladzislau Rezki
2023-04-06 17:50   ` Paul E. McKenney
2023-04-06 23:11     ` Zhang, Qiang1
2023-04-07  0:04       ` Paul E. McKenney
2023-04-07  1:26         ` Zhang, Qiang1
2023-04-07 15:33           ` Paul E. McKenney
2023-04-08  1:56             ` Zhang, Qiang1
2023-04-08  9:04               ` Uladzislau Rezki
2023-04-08  8:00         ` Uladzislau Rezki
2023-04-12  4:18           ` Zhang, Qiang1
2023-04-12 12:36             ` Uladzislau Rezki
2023-04-12 13:17               ` Uladzislau Rezki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).