#include "lwt.h"
#include "mem.h"
#include "tls.h"
+#include "rcu.h"
#define RCU_POST_THRESHOLD 10
#define RCU_QUEUE_SCALE 20
}
}
-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;
}