Eliminate unnecessary invalidations of the entire TLB by pmap_remove().

Specifically, on mappings with PG_G set pmap_remove() not only performs
the necessary per-page invlpg invalidations but also performs an
unnecessary invalidation of the entire set of non-PG_G entries.

Reviewed by: tegge
This commit is contained in:
Alan Cox 2006-03-21 18:07:42 +00:00
parent 6b422e20c1
commit fa8053e9a9
2 changed files with 14 additions and 2 deletions

View File

@ -1731,7 +1731,13 @@ pmap_remove(pmap_t pmap, vm_offset_t sva, vm_offset_t eva)
sva += PAGE_SIZE) {
if (*pte == 0)
continue;
anyvalid = 1;
/*
* The TLB entry for a PG_G mapping is invalidated
* by pmap_remove_pte().
*/
if ((*pte & PG_G) == 0)
anyvalid = 1;
if (pmap_remove_pte(pmap, pte, sva, ptpaddr))
break;
}

View File

@ -1719,7 +1719,13 @@ pmap_remove(pmap_t pmap, vm_offset_t sva, vm_offset_t eva)
sva += PAGE_SIZE) {
if (*pte == 0)
continue;
anyvalid = 1;
/*
* The TLB entry for a PG_G mapping is invalidated
* by pmap_remove_pte().
*/
if ((*pte & PG_G) == 0)
anyvalid = 1;
if (pmap_remove_pte(pmap, pte, sva))
break;
}