X-Git-Url: https://pd.if.org/git/?p=nbds;a=blobdiff_plain;f=runtime%2Frcu.c;h=50205e8670173c2d2ab55089ae1cac4b4bb80901;hp=5ae851be58f5ef7021a10a78aeda6142e01e181e;hb=a03cf3b0c40e6c3b8b4877b49a64288cb3fcb919;hpb=e592519ef19f890e551c27f47ef8b773bb4860da diff --git a/runtime/rcu.c b/runtime/rcu.c index 5ae851b..50205e8 100644 --- a/runtime/rcu.c +++ b/runtime/rcu.c @@ -12,6 +12,7 @@ #include "lwt.h" #include "mem.h" #include "tls.h" +#include "rcu.h" #define RCU_POST_THRESHOLD 10 #define RCU_QUEUE_SCALE 20 @@ -71,17 +72,18 @@ void rcu_update (void) { } } -void nbd_defer_free (void *x) { +void rcu_defer_free (void *x) { + assert(x); LOCALIZE_THREAD_LOCAL(tid_, int); fifo_t *q = pending_[tid_]; assert(MOD_SCALE(q->head + 1, q->scale) != MOD_SCALE(q->tail, q->scale)); uint32_t i = MOD_SCALE(q->head++, q->scale); q->x[i] = x; - TRACE("r0", "nbd_defer_free: put %p on queue at position %llu", x, pending_[tid_]->head); + TRACE("r0", "rcu_defer_free: put %p on queue at position %llu", x, pending_[tid_]->head); if (pending_[tid_]->head - rcu_last_posted_[tid_][tid_] < RCU_POST_THRESHOLD) return; - TRACE("r0", "nbd_defer_free: posting %llu", pending_[tid_]->head, 0); + TRACE("r0", "rcu_defer_free: posting %llu", pending_[tid_]->head, 0); int next_thread_id = (tid_ + 1) % num_threads_; rcu_[next_thread_id][tid_] = rcu_last_posted_[tid_][tid_] = pending_[tid_]->head; }