X-Git-Url: https://pd.if.org/git/?p=nbds;a=blobdiff_plain;f=runtime%2Frcu.c;fp=runtime%2Frcu.c;h=8120713aa2a2f51adbaa2e69217dc18892a69abc;hp=0c491334c30acd71aa966986e323cc1d4ea6d403;hb=778b8c8ca708b082a1192acfb114a6751b2ad7c9;hpb=5aa9223647fbb52fa8941d92c8896ebaf148b41c diff --git a/runtime/rcu.c b/runtime/rcu.c index 0c49133..8120713 100644 --- a/runtime/rcu.c +++ b/runtime/rcu.c @@ -31,7 +31,7 @@ static fifo_t *pending_[MAX_NUM_THREADS] = {}; static int num_threads_ = 0; static fifo_t *fifo_alloc(int scale) { - fifo_t *q = (fifo_t *)nbd_malloc(sizeof(fifo_t) + (1 << scale) * sizeof(void *)); + fifo_t *q = (fifo_t *)nbd_malloc(sizeof(fifo_t) + (1ULL << scale) * sizeof(void *)); memset(q, 0, sizeof(fifo_t)); q->scale = scale; q->head = 0; @@ -51,6 +51,7 @@ void rcu_update (void) { LOCALIZE_THREAD_LOCAL(tid_, int); assert(tid_ < num_threads_); int next_thread_id = (tid_ + 1) % num_threads_; + TRACE("r1", "rcu_update: updating thread %llu", next_thread_id, 0); int i; for (i = 0; i < num_threads_; ++i) { if (i == tid_) @@ -62,6 +63,7 @@ void rcu_update (void) { uint64_t x = rcu_[tid_][i]; rcu_[next_thread_id][i] = rcu_last_posted_[tid_][i] = x; + TRACE("r2", "rcu_update: posted updated value (%llu) for thread %llu", x, i); } // free