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.
This commit is contained in:
Alan Cox 2003-08-18 01:31:43 +00:00
parent a37fe9e7cd
commit ef13663bb6
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=119059

View File

@ -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.