summaryrefslogtreecommitdiffstats
path: root/sys/vm/vm_glue.c
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2003-08-18 01:31:43 +0000
committeralc <alc@FreeBSD.org>2003-08-18 01:31:43 +0000
commit8d4e01126d6842265cac0ee816e747bf44148e77 (patch)
tree9deca15ab56dab0d8928f44be0cab545b5f24eda /sys/vm/vm_glue.c
parentdc943d848be90fea260421da6c01771d65fbb19f (diff)
downloadFreeBSD-src-8d4e01126d6842265cac0ee816e747bf44148e77.zip
FreeBSD-src-8d4e01126d6842265cac0ee816e747bf44148e77.tar.gz
Three unrelated changes to vm_proc_new(): (1) add vm object locking on the
U pages object; (2) reorganize such that the U pages object is created and filled in one block; and (3) remove an unnecessary clearing of PG_ZERO.
Diffstat (limited to 'sys/vm/vm_glue.c')
-rw-r--r--sys/vm/vm_glue.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/sys/vm/vm_glue.c b/sys/vm/vm_glue.c
index 821e511..6e2872f 100644
--- a/sys/vm/vm_glue.c
+++ b/sys/vm/vm_glue.c
@@ -222,12 +222,6 @@ vm_proc_new(struct proc *p)
u_int i;
/*
- * Allocate object for the upage.
- */
- upobj = vm_object_allocate(OBJT_DEFAULT, UAREA_PAGES);
- p->p_upages_obj = upobj;
-
- /*
* Get a kernel virtual address for the U area for this process.
*/
up = kmem_alloc_nofault(kernel_map, UAREA_PAGES * PAGE_SIZE);
@@ -235,20 +229,23 @@ vm_proc_new(struct proc *p)
panic("vm_proc_new: upage allocation failed");
p->p_uarea = (struct user *)up;
+ /*
+ * Allocate object and page(s) for the U area.
+ */
+ upobj = vm_object_allocate(OBJT_DEFAULT, UAREA_PAGES);
+ p->p_upages_obj = upobj;
+ VM_OBJECT_LOCK(upobj);
for (i = 0; i < UAREA_PAGES; i++) {
- /*
- * Get a uarea page.
- */
m = vm_page_grab(upobj, i,
VM_ALLOC_NORMAL | VM_ALLOC_RETRY | VM_ALLOC_WIRED);
ma[i] = m;
vm_page_lock_queues();
vm_page_wakeup(m);
- vm_page_flag_clear(m, PG_ZERO);
m->valid = VM_PAGE_BITS_ALL;
vm_page_unlock_queues();
}
+ VM_OBJECT_UNLOCK(upobj);
/*
* Enter the pages into the kernel address space.
OpenPOWER on IntegriCloud