X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=rculfhash.c;h=7605036555f9526cfafbc8a1265ba4d732499a97;hb=df03fab8d93f4778ff06cad3e6aef2a61c65170c;hp=606f46e904b2fde4e0c3f4be1e66d5e5a437929d;hpb=24365af70940dac62e3910e566e91f549a045423;p=urcu.git diff --git a/rculfhash.c b/rculfhash.c index 606f46e..7605036 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 @@ -736,8 +736,8 @@ void _do_ht_resize(struct rcu_ht *ht) if (old_size == new_size) return; new_order = get_count_order_ulong(new_size) + 1; - dbg_printf("rculfhash: resize from %lu (order %lu) to %lu (order %lu) buckets\n", - old_size, old_order, new_size, new_order); + printf("rculfhash: resize from %lu (order %lu) to %lu (order %lu) buckets\n", + old_size, old_order, new_size, new_order); new_t = malloc(sizeof(struct rcu_table) + (new_order * sizeof(struct _rcu_ht_node *))); assert(new_size > old_size);