netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] flowcache: Tune per cpu flow cache shrink size
@ 2014-03-14  7:42 Fan Du
  2014-03-14 10:26 ` Steffen Klassert
  2014-03-14 18:43 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Fan Du @ 2014-03-14  7:42 UTC (permalink / raw)
  To: steffen.klassert; +Cc: davem, netdev

When per cpu flow cache entries count reaches over high_watermark,
flow cache will be shrinked gently to around low_watermark, not
brutally killing most of cached entries by left only two.

Signed-off-by: Fan Du <fan.du@windriver.com>
---
 net/core/flow.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/core/flow.c b/net/core/flow.c
index 31cfb365e0c6..e379cdcd699b 100644
--- a/net/core/flow.c
+++ b/net/core/flow.c
@@ -142,7 +142,7 @@ static void __flow_cache_shrink(struct flow_cache *fc,
 static void flow_cache_shrink(struct flow_cache *fc,
 			      struct flow_cache_percpu *fcp)
 {
-	int shrink_to = fc->low_watermark / flow_cache_hash_size(fc);
+	int shrink_to = fc->low_watermark;
 
 	__flow_cache_shrink(fc, fcp, shrink_to);
 }
-- 
1.7.9.5

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

end of thread, other threads:[~2014-03-14 18:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-14  7:42 [PATCH net-next] flowcache: Tune per cpu flow cache shrink size Fan Du
2014-03-14 10:26 ` Steffen Klassert
2014-03-14 18:43 ` David Miller

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).