diff options
author | Austin Clements <[email protected]> | 2011-09-01 21:29:09 -0400 |
---|---|---|
committer | Austin Clements <[email protected]> | 2011-09-01 21:29:09 -0400 |
commit | 052e18485d19f26d4182a662054369926d0c4dd0 (patch) | |
tree | ccbb08c086a571069550f26635555a201c747c67 | |
parent | 1eadf4a8fcc34f79075bb61d3546be303745e461 (diff) | |
download | xv6-labs-052e18485d19f26d4182a662054369926d0c4dd0.tar.gz xv6-labs-052e18485d19f26d4182a662054369926d0c4dd0.tar.bz2 xv6-labs-052e18485d19f26d4182a662054369926d0c4dd0.zip |
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.
-rw-r--r-- | vm.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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"); |