From 8d4e01126d6842265cac0ee816e747bf44148e77 Mon Sep 17 00:00:00 2001 From: alc Date: Mon, 18 Aug 2003 01:31:43 +0000 Subject: 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. --- sys/vm/vm_glue.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'sys/vm/vm_glue.c') 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. -- cgit v1.1