rculfhash: tolerate longer chain length
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 11 Jul 2011 21:32:55 +0000 (17:32 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 11 Jul 2011 21:32:55 +0000 (17:32 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
rculfhash.c

index 606f46e904b2fde4e0c3f4be1e66d5e5a437929d..6941ec189df941ca7fe71616d50d57c2dc8b8aa5 100644 (file)
@@ -46,8 +46,8 @@
 #define dbg_printf(args...)
 #endif
 
-#define CHAIN_LEN_TARGET               1
-#define CHAIN_LEN_RESIZE_THRESHOLD     2
+#define CHAIN_LEN_TARGET               4
+#define CHAIN_LEN_RESIZE_THRESHOLD     8
 
 #ifndef max
 #define max(a, b)      ((a) > (b) ? (a) : (b))
@@ -290,7 +290,7 @@ void check_resize(struct rcu_ht *ht, struct rcu_table *t,
                           chain_len);
        if (chain_len >= CHAIN_LEN_RESIZE_THRESHOLD)
                ht_resize_lazy(ht, t,
-                       get_count_order_u32(chain_len - CHAIN_LEN_TARGET + 1));
+                       get_count_order_u32(chain_len - (CHAIN_LEN_TARGET - 1)));
 }
 
 static
This page took 0.02642 seconds and 4 git commands to generate.