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

avoid pushcli/popcli

上级 40c96d6a
...@@ -196,22 +196,15 @@ tlbflush() ...@@ -196,22 +196,15 @@ tlbflush()
{ {
u64 myreq = tlbflush_req++; u64 myreq = tlbflush_req++;
pushcli();
// the caller may not hold any spinlock, because other CPUs might // the caller may not hold any spinlock, because other CPUs might
// be spinning waiting for that spinlock, with interrupts disabled, // be spinning waiting for that spinlock, with interrupts disabled,
// so we will deadlock waiting for their TLB flush.. // so we will deadlock waiting for their TLB flush..
assert(mycpu()->ncli == 1); assert(mycpu()->ncli == 0);
int myid = mycpu()->id;
lcr3(rcr3());
popcli();
for (int i = 0; i < ncpu; i++) for (int i = 0; i < ncpu; i++)
if (i != myid)
lapic_tlbflush(i); lapic_tlbflush(i);
for (int i = 0; i < ncpu; i++) for (int i = 0; i < ncpu; i++)
if (i != myid)
while (cpus[i].tlbflush_done < myreq) while (cpus[i].tlbflush_done < myreq)
/* spin */ ; /* spin */ ;
} }
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论