rculfhash: tweak resize thresholds
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 7 Sep 2011 15:58:33 +0000 (08:58 -0700)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 7 Sep 2011 15:58:33 +0000 (08:58 -0700)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
rculfhash.c

index 76d9a3a08bd5357587a597f055553abbcc4fac4e..5719bc2c8a418fcd2ef54df7518caa7e14ab4790 100644 (file)
  * tables and machines lacking per-cpu data suppport.
  */
 #define COUNT_COMMIT_ORDER             10
-#define CHAIN_LEN_TARGET               4
-#define CHAIN_LEN_RESIZE_THRESHOLD     8
+#define CHAIN_LEN_TARGET               1
+#define CHAIN_LEN_RESIZE_THRESHOLD     3
 
 #ifndef max
 #define max(a, b)      ((a) > (b) ? (a) : (b))
@@ -373,9 +373,6 @@ void cds_lfht_resize_lazy(struct cds_lfht *ht, struct rcu_table *t, int growth);
  * In the unfortunate event the number of CPUs reported would be
  * inaccurate, we use modulo arithmetic on the number of CPUs we got.
  */
-//test  #undef HAVE_SCHED_GETCPU
-#undef HAVE_SCHED_GETCPU
-
 #if defined(HAVE_SCHED_GETCPU) && defined(HAVE_SYSCONF)
 
 static
@@ -458,7 +455,7 @@ void ht_count_add(struct cds_lfht *ht, struct rcu_table *t)
                                return;
                        dbg_printf("add set global %lu\n", count);
                        cds_lfht_resize_lazy_count(ht, t,
-                               count >> CHAIN_LEN_TARGET);
+                               count >> (CHAIN_LEN_TARGET - 1));
                }
        }
 }
@@ -488,7 +485,7 @@ void ht_count_remove(struct cds_lfht *ht, struct rcu_table *t)
                                return;
                        dbg_printf("remove set global %lu\n", count);
                        cds_lfht_resize_lazy_count(ht, t,
-                               count >> CHAIN_LEN_TARGET);
+                               count >> (CHAIN_LEN_TARGET - 1));
                }
        }
 }
This page took 0.026321 seconds and 4 git commands to generate.