if ((count >> CHAIN_LEN_RESIZE_THRESHOLD) < size)
return;
dbg_printf("add set global %ld\n", count);
- /*
- * Don't resize table if the number of nodes is below a
- * certain threshold.
- */
- if (count < (1UL << COUNT_COMMIT_ORDER))
- return;
cds_lfht_resize_lazy_count(ht, size,
count >> (CHAIN_LEN_TARGET - 1));
}
return;
dbg_printf("del set global %ld\n", count);
/*
- * Don't resize table if the number of nodes is below a
+ * Don't shrink table if the number of nodes is below a
* certain threshold.
*/
- if (count < (1UL << COUNT_COMMIT_ORDER))
+ if (count < (1UL << COUNT_COMMIT_ORDER) * (nr_cpus_mask + 1))
return;
cds_lfht_resize_lazy_count(ht, size,
count >> (CHAIN_LEN_TARGET - 1));
node = clear_flag(node);
for (;;) {
if (unlikely(is_end(node))) {
- node = NULL;
+ node = next = NULL;
break;
}
if (unlikely(node->p.reverse_hash > reverse_hash)) {
- node = NULL;
+ node = next = NULL;
break;
}
next = rcu_dereference(node->p.next);
for (;;) {
if (unlikely(is_end(node))) {
- node = NULL;
+ node = next = NULL;
break;
}
if (unlikely(node->p.reverse_hash > reverse_hash)) {
- node = NULL;
+ node = next = NULL;
break;
}
next = rcu_dereference(node->p.next);
}
void cds_lfht_count_nodes(struct cds_lfht *ht,
- unsigned long *approx_before,
+ long *approx_before,
unsigned long *count,
unsigned long *removed,
- unsigned long *approx_after)
+ long *approx_after)
{
struct cds_lfht_node *node, *next;
struct _cds_lfht_node *lookup;