提交 446cb46d 创建 作者: Nickolai Zeldovich's avatar Nickolai Zeldovich

avoid deadlock

上级 fe8f6fc2
...@@ -19,10 +19,10 @@ struct rcu { ...@@ -19,10 +19,10 @@ struct rcu {
static struct rcu *rcu_delayed_head __attribute__ ((aligned (CACHELINE))); static struct rcu *rcu_delayed_head __attribute__ ((aligned (CACHELINE)));
static struct rcu *rcu_delayed_tail __attribute__ ((aligned (CACHELINE))); static struct rcu *rcu_delayed_tail __attribute__ ((aligned (CACHELINE)));
static struct rcu *rcu_freelist __attribute__ ((aligned (CACHELINE))); static struct rcu *rcu_freelist __attribute__ ((aligned (CACHELINE)));
static uint global_epoch __attribute__ ((aligned (CACHELINE))); static static uint global_epoch __attribute__ ((aligned (CACHELINE)));
uint min_epoch __attribute__ ((aligned (CACHELINE))); static struct static uint min_epoch __attribute__ ((aligned (CACHELINE)));
spinlock rcu_lock __attribute__ ((aligned (CACHELINE))); static int static struct spinlock rcu_lock __attribute__ ((aligned (CACHELINE)));
delayed_nfree __attribute__ ((aligned (CACHELINE))); static int delayed_nfree __attribute__ ((aligned (CACHELINE)));
void void
rcuinit(void) rcuinit(void)
...@@ -68,9 +68,9 @@ rcu_gc(void) ...@@ -68,9 +68,9 @@ rcu_gc(void)
int n = 0; int n = 0;
min_epoch = global_epoch; min_epoch = global_epoch;
ns_enumerate(nspid, rcu_min);
acquire(&rcu_lock); acquire(&rcu_lock);
ns_enumerate(nspid, rcu_min);
for (r = rcu_delayed_head; r != NULL; r = nr) { for (r = rcu_delayed_head; r != NULL; r = nr) {
if (r->epoch >= min_epoch) if (r->epoch >= min_epoch)
break; break;
......
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论