rculfhash: add list iteration tracer in gc
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Sun, 11 Sep 2011 03:53:30 +0000 (20:53 -0700)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Sun, 11 Sep 2011 03:53:30 +0000 (20:53 -0700)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
rculfhash.c

index ee4bea24c11340e5253612c51fad50c891020622..6a80049ddd1f783a21e117d63437eec5771ba514 100644 (file)
@@ -675,15 +675,20 @@ static
 void _cds_lfht_gc_bucket(struct cds_lfht_node *dummy, struct cds_lfht_node *node)
 {
        struct cds_lfht_node *iter_prev, *iter, *next, *new_next;
+       struct cds_lfht_node *iter_trace[64];
+       unsigned long trace_idx = 0;
 
+       memset(iter_trace, 0, sizeof(iter_trace));
        assert(!is_dummy(dummy));
        assert(!is_removed(dummy));
        assert(!is_dummy(node));
        assert(!is_removed(node));
        for (;;) {
+               iter_trace[trace_idx++ & (64 - 1)] = (void *) 0x1;
                iter_prev = dummy;
                /* We can always skip the dummy node initially */
                iter = rcu_dereference(iter_prev->p.next);
+               iter_trace[trace_idx++ & (64 - 1)] = iter;
                assert(iter_prev->p.reverse_hash <= node->p.reverse_hash);
                /*
                 * We should never be called with dummy (start of chain)
@@ -702,6 +707,7 @@ void _cds_lfht_gc_bucket(struct cds_lfht_node *dummy, struct cds_lfht_node *node
                                break;
                        iter_prev = clear_flag(iter);
                        iter = next;
+                       iter_trace[trace_idx++ & (64 - 1)] = iter;
                }
                assert(!is_removed(iter));
                if (is_dummy(iter))
@@ -709,6 +715,7 @@ void _cds_lfht_gc_bucket(struct cds_lfht_node *dummy, struct cds_lfht_node *node
                else
                        new_next = clear_flag(next);
                (void) uatomic_cmpxchg(&iter_prev->p.next, iter, new_next);
+               iter_trace[trace_idx++ & (64 - 1)] = (void *) 0x2;
        }
 }
 
This page took 0.034291 seconds and 4 git commands to generate.