From: Mathieu Desnoyers Date: Mon, 11 Jul 2011 21:32:55 +0000 (-0400) Subject: rculfhash: tolerate longer chain length X-Git-Tag: v0.7.0~43^2~198 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=01370f0b44f53c26c5a1b9387a94ac37f89bc289;p=urcu.git rculfhash: tolerate longer chain length Signed-off-by: Mathieu Desnoyers --- diff --git a/rculfhash.c b/rculfhash.c index 606f46e..6941ec1 100644 --- a/rculfhash.c +++ b/rculfhash.c @@ -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