diff options
author | alc <alc@FreeBSD.org> | 2003-02-03 00:05:11 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2003-02-03 00:05:11 +0000 |
commit | c41203831b757432b9a1ed2f554b7c1efe380242 (patch) | |
tree | 27895aed38265a24ae57cc4e15e1c1fbec5404bf /sys/amd64 | |
parent | 3df9deadf20433b53f8cd89697e0c34c113d25db (diff) | |
download | FreeBSD-src-c41203831b757432b9a1ed2f554b7c1efe380242.zip FreeBSD-src-c41203831b757432b9a1ed2f554b7c1efe380242.tar.gz |
- Make allpmaps static.
- Use atomic subtract to update the global wired pages count. (See
also vm/vm_page.c revision 1.233.)
- Assert that the page queue lock is held in pmap_remove_entry().
Diffstat (limited to 'sys/amd64')
-rw-r--r-- | sys/amd64/amd64/pmap.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 37e0eb8..40d97b8 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -151,7 +151,7 @@ static int protection_codes[8]; struct pmap kernel_pmap_store; LIST_HEAD(pmaplist, pmap); -struct pmaplist allpmaps; +static struct pmaplist allpmaps; vm_offset_t avail_start; /* PA of first available physical page */ vm_offset_t avail_end; /* PA of last available physical page */ @@ -1180,7 +1180,7 @@ _pmap_unwire_pte_hold(pmap_t pmap, vm_page_t m) if (m->wire_count == 0) { vm_page_busy(m); vm_page_free_zero(m); - --cnt.v_wire_count; + atomic_subtract_int(&cnt.v_wire_count, 1); } return 1; } @@ -1353,7 +1353,7 @@ pmap_release_free_page(pmap_t pmap, vm_page_t p) pmap->pm_ptphint = NULL; p->wire_count--; - cnt.v_wire_count--; + atomic_subtract_int(&cnt.v_wire_count, 1); vm_page_free_zero(p); vm_page_unlock_queues(); return 1; @@ -1639,6 +1639,7 @@ pmap_remove_entry(pmap_t pmap, vm_page_t m, vm_offset_t va) int s; s = splvm(); + mtx_assert(&vm_page_queue_mtx, MA_OWNED); if (m->md.pv_list_count < pmap->pm_stats.resident_count) { TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) { if (pmap == pv->pv_pmap && va == pv->pv_va) |