summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
732ad07)
Accept to target bucket len greater than 1 to diminish the memory
consumption without too much performance impact.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
#define dbg_printf(args...)
#endif
#define dbg_printf(args...)
#endif
-#define BUCKET_SIZE_RESIZE_THRESHOLD 4
+#define CHAIN_LEN_TARGET 4
+#define CHAIN_LEN_RESIZE_THRESHOLD 16
#ifndef max
#define max(a, b) ((a) > (b) ? (a) : (b))
#ifndef max
#define max(a, b) ((a) > (b) ? (a) : (b))
void check_resize(struct rcu_ht *ht, struct rcu_table *t,
uint32_t chain_len)
{
void check_resize(struct rcu_ht *ht, struct rcu_table *t,
uint32_t chain_len)
{
- if (chain_len >= BUCKET_SIZE_RESIZE_THRESHOLD)
- ht_resize_lazy(ht, t, log2_u32(chain_len));
+ if (chain_len >= CHAIN_LEN_RESIZE_THRESHOLD)
+ ht_resize_lazy(ht, t,
+ log2_u32(chain_len - CHAIN_LEN_TARGET));