rculfhash: print resize length (useful as non-debug for now)
[urcu.git] / rculfhash.c
index 606f46e904b2fde4e0c3f4be1e66d5e5a437929d..7605036555f9526cfafbc8a1265ba4d732499a97 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
@@ -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);
This page took 0.023374 seconds and 4 git commands to generate.