From ef13663bb684bb0acc8a3a17daf69ce518ee2968 Mon Sep 17 00:00:00 2001 From: Alan Cox 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(-) diff --git a/sys/vm/vm_glue.c b/sys/vm/vm_glue.c index 821e51198df94..6e2872f65ebfa 100644 --- a/sys/vm/vm_glue.c +++ b/sys/vm/vm_glue.c @@ -221,12 +221,6 @@ vm_proc_new(struct proc *p) vm_page_t m; 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. */ @@ -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.3