diff options
author | alc <alc@FreeBSD.org> | 2002-07-29 05:42:44 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2002-07-29 05:42:44 +0000 |
commit | ca32cecfcfe6ceb74d047ffd192584fc8c38fe1c (patch) | |
tree | 54ab570447182c5d9a6dde6b3c510f6c6e9a5f1d /sys | |
parent | 4eb45c786287e1948e9e1de069d3e7d892bdaf92 (diff) | |
download | FreeBSD-src-ca32cecfcfe6ceb74d047ffd192584fc8c38fe1c.zip FreeBSD-src-ca32cecfcfe6ceb74d047ffd192584fc8c38fe1c.tar.gz |
o Pass VM_ALLOC_WIRED to vm_page_grab() rather than calling vm_page_wire()
in pmap_new_thread(), pmap_pinit(), and vm_proc_new().
o Lock page queue accesses by vm_page_free() in pmap_object_init_pt().
Diffstat (limited to 'sys')
-rw-r--r-- | sys/amd64/amd64/pmap.c | 18 | ||||
-rw-r--r-- | sys/i386/i386/pmap.c | 18 | ||||
-rw-r--r-- | sys/vm/vm_glue.c | 9 |
3 files changed, 12 insertions, 33 deletions
diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 13c3c7d..612d947 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -974,15 +974,10 @@ pmap_new_thread(struct thread *td) /* * Get a kernel stack page */ - m = vm_page_grab(ksobj, i, VM_ALLOC_NORMAL | VM_ALLOC_RETRY); + m = vm_page_grab(ksobj, i, + VM_ALLOC_NORMAL | VM_ALLOC_RETRY | VM_ALLOC_WIRED); ma[i] = m; - /* - * Wire the page - */ - m->wire_count++; - cnt.v_wire_count++; - vm_page_wakeup(m); vm_page_flag_clear(m, PG_ZERO); vm_page_flag_set(m, PG_MAPPED | PG_WRITEABLE); @@ -1222,12 +1217,7 @@ pmap_pinit(pmap) * allocate the page directory page */ ptdpg = vm_page_grab(pmap->pm_pteobj, PTDPTDI, - VM_ALLOC_NORMAL | VM_ALLOC_RETRY); - - ptdpg->wire_count = 1; - ++cnt.v_wire_count; - - + VM_ALLOC_NORMAL | VM_ALLOC_RETRY | VM_ALLOC_WIRED); vm_page_flag_clear(ptdpg, PG_MAPPED | PG_BUSY); /* not usually mapped*/ ptdpg->valid = VM_PAGE_BITS_ALL; @@ -2347,7 +2337,9 @@ retry: m[0] = p; if (vm_pager_get_pages(object, m, 1, 0) != VM_PAGER_OK) { + vm_page_lock_queues(); vm_page_free(p); + vm_page_unlock_queues(); return; } diff --git a/sys/i386/i386/pmap.c b/sys/i386/i386/pmap.c index 13c3c7d..612d947 100644 --- a/sys/i386/i386/pmap.c +++ b/sys/i386/i386/pmap.c @@ -974,15 +974,10 @@ pmap_new_thread(struct thread *td) /* * Get a kernel stack page */ - m = vm_page_grab(ksobj, i, VM_ALLOC_NORMAL | VM_ALLOC_RETRY); + m = vm_page_grab(ksobj, i, + VM_ALLOC_NORMAL | VM_ALLOC_RETRY | VM_ALLOC_WIRED); ma[i] = m; - /* - * Wire the page - */ - m->wire_count++; - cnt.v_wire_count++; - vm_page_wakeup(m); vm_page_flag_clear(m, PG_ZERO); vm_page_flag_set(m, PG_MAPPED | PG_WRITEABLE); @@ -1222,12 +1217,7 @@ pmap_pinit(pmap) * allocate the page directory page */ ptdpg = vm_page_grab(pmap->pm_pteobj, PTDPTDI, - VM_ALLOC_NORMAL | VM_ALLOC_RETRY); - - ptdpg->wire_count = 1; - ++cnt.v_wire_count; - - + VM_ALLOC_NORMAL | VM_ALLOC_RETRY | VM_ALLOC_WIRED); vm_page_flag_clear(ptdpg, PG_MAPPED | PG_BUSY); /* not usually mapped*/ ptdpg->valid = VM_PAGE_BITS_ALL; @@ -2347,7 +2337,9 @@ retry: m[0] = p; if (vm_pager_get_pages(object, m, 1, 0) != VM_PAGER_OK) { + vm_page_lock_queues(); vm_page_free(p); + vm_page_unlock_queues(); return; } diff --git a/sys/vm/vm_glue.c b/sys/vm/vm_glue.c index 36f709d..ca1d582 100644 --- a/sys/vm/vm_glue.c +++ b/sys/vm/vm_glue.c @@ -230,15 +230,10 @@ vm_proc_new(struct proc *p) /* * Get a uarea page. */ - m = vm_page_grab(upobj, i, VM_ALLOC_NORMAL | VM_ALLOC_RETRY); + m = vm_page_grab(upobj, i, + VM_ALLOC_NORMAL | VM_ALLOC_RETRY | VM_ALLOC_WIRED); ma[i] = m; - /* - * Wire the page. - */ - m->wire_count++; - cnt.v_wire_count++; - vm_page_wakeup(m); vm_page_flag_clear(m, PG_ZERO); vm_page_flag_set(m, PG_MAPPED | PG_WRITEABLE); |