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

single flag to disable tlb shootdowns (for experimental purposes).

with tlb shootdowns disabled, radix scales linearly, and crange has sub-linear scaling. with VM_RADIX: $ time mapbench 1 12834002141 cycles $ time mapbench 2 12230873801 cycles $ time mapbench 16 12300269260 cycles with VM_CRANGE: $ time mapbench 1 12969300915 cycles $ time mapbench 2 15277712346 cycles $ time mapbench 16 58582887683 cycles
上级 323d260b
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#include "kmtrace.hh" #include "kmtrace.hh"
enum { vm_debug = 0 }; enum { vm_debug = 0 };
enum { tlb_shootdown = 1 };
enum { tlb_lazy = 1 }; enum { tlb_lazy = 1 };
/* /*
...@@ -320,8 +321,14 @@ vmap::copy(int share) ...@@ -320,8 +321,14 @@ vmap::copy(int share)
#endif #endif
} }
if (share) if (share) {
tlbflush(); // Reload hardware page table // Reload hardware page table
if (tlb_shootdown) {
tlbflush();
} else {
lcr3(rcr3());
}
}
nm->brk_ = brk_; nm->brk_ = brk_;
...@@ -434,11 +441,13 @@ again: ...@@ -434,11 +441,13 @@ again:
} }
} }
}); });
if (tlb_shootdown) {
if (needtlb && dotlb) if (needtlb && dotlb)
tlbflush(); tlbflush();
else else
if (tlb_lazy) if (tlb_lazy)
tlbflush(myproc()->unmap_tlbreq_); tlbflush(myproc()->unmap_tlbreq_);
}
return vma_start; return vma_start;
} }
...@@ -488,7 +497,7 @@ vmap::remove(uptr vma_start, uptr len) ...@@ -488,7 +497,7 @@ vmap::remove(uptr vma_start, uptr len)
} }
} }
}); });
if (needtlb) { if (tlb_shootdown && needtlb) {
if (tlb_lazy) { if (tlb_lazy) {
myproc()->unmap_tlbreq_ = tlbflush_req++; myproc()->unmap_tlbreq_ = tlbflush_req++;
} else { } else {
...@@ -578,7 +587,11 @@ vmap::pagefault(uptr va, u32 err) ...@@ -578,7 +587,11 @@ vmap::pagefault(uptr va, u32 err)
if (pagefault_wcow(m) < 0) if (pagefault_wcow(m) < 0)
return -1; return -1;
if (tlb_shootdown) {
tlbflush(); tlbflush();
} else {
lcr3(rcr3());
}
goto retry; goto retry;
} }
......
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论