diff options
author | alc <alc@FreeBSD.org> | 2004-07-15 18:00:43 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2004-07-15 18:00:43 +0000 |
commit | 123cfa6b6464882431662931da12282fdae27c31 (patch) | |
tree | 69cdf9b62bb15fd8fb4fcd13d7dc53217029e5ad /sys/amd64 | |
parent | c9b72f6bbfe07882de4c1ff97b23d8419bb01672 (diff) | |
download | FreeBSD-src-123cfa6b6464882431662931da12282fdae27c31.zip FreeBSD-src-123cfa6b6464882431662931da12282fdae27c31.tar.gz |
Push down the acquisition and release of the page queues lock into
pmap_protect() and pmap_remove(). In general, they require the lock in
order to modify a page's pv list or flags. In some cases, however,
pmap_protect() can avoid acquiring the lock.
Diffstat (limited to 'sys/amd64')
-rw-r--r-- | sys/amd64/amd64/pmap.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 9dd4f67..39436b9 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -1602,6 +1602,8 @@ pmap_remove(pmap_t pmap, vm_offset_t sva, vm_offset_t eva) */ if (pmap->pm_stats.resident_count == 0) return; + + vm_page_lock_queues(); PMAP_LOCK(pmap); /* @@ -1613,8 +1615,7 @@ pmap_remove(pmap_t pmap, vm_offset_t sva, vm_offset_t eva) pde = pmap_pde(pmap, sva); if (pde && (*pde & PG_PS) == 0) { pmap_remove_page(pmap, sva); - PMAP_UNLOCK(pmap); - return; + goto out; } } @@ -1684,6 +1685,8 @@ pmap_remove(pmap_t pmap, vm_offset_t sva, vm_offset_t eva) if (anyvalid) pmap_invalidate_all(pmap); +out: + vm_page_unlock_queues(); PMAP_UNLOCK(pmap); } @@ -1778,6 +1781,7 @@ pmap_protect(pmap_t pmap, vm_offset_t sva, vm_offset_t eva, vm_prot_t prot) anychanged = 0; + vm_page_lock_queues(); PMAP_LOCK(pmap); for (; sva < eva; sva = va_next) { @@ -1856,6 +1860,7 @@ pmap_protect(pmap_t pmap, vm_offset_t sva, vm_offset_t eva, vm_prot_t prot) } if (anychanged) pmap_invalidate_all(pmap); + vm_page_unlock_queues(); PMAP_UNLOCK(pmap); } |