提交 052e1848 创建 作者: Austin Clements's avatar Austin Clements

Skip missing page directories in deallocuvm

Previously, deallocuvm scanned from 0 to KERNBASE in one page increments, which had a noticable effect on boot time. Now it skips over missing page directories.
上级 1eadf4a8
......@@ -261,7 +261,9 @@ deallocuvm(pde_t *pgdir, uint oldsz, uint newsz)
a = PGROUNDUP(newsz);
for(; a < oldsz; a += PGSIZE){
pte = walkpgdir(pgdir, (char*)a, 0);
if(pte && (*pte & PTE_P) != 0){
if(!pte)
a += (NPTENTRIES - 1) * PGSIZE;
else if((*pte & PTE_P) != 0){
pa = PTE_ADDR(*pte);
if(pa == 0)
panic("kfree");
......
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论