[sheepdog] [PATCH] object cache: do reclaim when reaching HIGH_WATERMARK

Liu Yuan namei.unix at gmail.com
Mon Jan 28 08:36:03 CET 2013


From: Liu Yuan <tailai.ly at taobao.com>

If we use dedicated disk for object cache, we can't overrun the specified size.

Signed-off-by: Liu Yuan <tailai.ly at taobao.com>
---
 sheep/object_cache.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sheep/object_cache.c b/sheep/object_cache.c
index db7d936..4e26392 100644
--- a/sheep/object_cache.c
+++ b/sheep/object_cache.c
@@ -621,7 +621,7 @@ void object_cache_try_to_reclaim(int delay)
 	if (!sys->object_cache_size)
 		return;
 
-	if (uatomic_read(&gcache.capacity) < sys->object_cache_size)
+	if (uatomic_read(&gcache.capacity) < HIGH_WATERMARK)
 		return;
 
 	if (!uatomic_set_true(&gcache.in_reclaim))
-- 
1.7.9.5




More information about the sheepdog mailing list