diff options
-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); |