diff options
Diffstat (limited to 'sys/uvm')
-rw-r--r-- | sys/uvm/uvm_page.c | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/sys/uvm/uvm_page.c b/sys/uvm/uvm_page.c index a431450748a..9db5d419b68 100644 --- a/sys/uvm/uvm_page.c +++ b/sys/uvm/uvm_page.c @@ -1,9 +1,9 @@ -/* $OpenBSD: uvm_page.c,v 1.104 2011/04/02 16:47:17 beck Exp $ */ +/* $OpenBSD: uvm_page.c,v 1.105 2011/04/03 12:36:08 beck Exp $ */ /* $NetBSD: uvm_page.c,v 1.44 2000/11/27 08:40:04 chs Exp $ */ -/* +/* * Copyright (c) 1997 Charles D. Cranor and Washington University. - * Copyright (c) 1991, 1993, The Regents of the University of California. + * Copyright (c) 1991, 1993, The Regents of the University of California. * * All rights reserved. * @@ -21,7 +21,7 @@ * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by Charles D. Cranor, - * Washington University, the University of California, Berkeley and + * Washington University, the University of California, Berkeley and * its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software @@ -45,17 +45,17 @@ * * Copyright (c) 1987, 1990 Carnegie-Mellon University. * All rights reserved. - * + * * Permission to use, copy, modify and distribute this software and * its documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" - * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * + * * Carnegie Mellon requests users of this software to return to * * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU @@ -159,7 +159,7 @@ uvm_pageinsert(struct vm_page *pg) UVMHIST_FUNC("uvm_pageinsert"); UVMHIST_CALLED(pghist); KASSERT((pg->pg_flags & PG_TABLED) == 0); - /* XXX should we check duplicates? */ + /* XXX should we check duplicates? */ RB_INSERT(uvm_objtree, &pg->uobject->memt, pg); atomic_setbits_int(&pg->pg_flags, PG_TABLED); pg->uobject->uo_npages++; @@ -188,7 +188,7 @@ uvm_pageremove(struct vm_page *pg) /* * uvm_page_init: init the page system. called from uvm_init(). - * + * * => we return the range of kernel virtual memory in kvm_startp/kvm_endp */ @@ -197,9 +197,9 @@ uvm_page_init(vaddr_t *kvm_startp, vaddr_t *kvm_endp) { vsize_t freepages, pagecount, n; vm_page_t pagearray; - int lcv, i; + int lcv, i; paddr_t paddr; -#if defined(UVMHIST) +#if defined(UVMHIST) static struct uvm_history_ent pghistbuf[100]; #endif @@ -218,7 +218,7 @@ uvm_page_init(vaddr_t *kvm_startp, vaddr_t *kvm_endp) mtx_init(&uvm.fpageqlock, IPL_VM); uvm_pmr_init(); - /* + /* * allocate vm_page structures. */ @@ -231,15 +231,15 @@ uvm_page_init(vaddr_t *kvm_startp, vaddr_t *kvm_endp) if (vm_nphysseg == 0) panic("uvm_page_bootstrap: no memory pre-allocated"); - + /* - * first calculate the number of free pages... + * first calculate the number of free pages... * * note that we use start/end rather than avail_start/avail_end. * this allows us to allocate extra vm_page structures in case we * want to return some memory to the pool after booting. */ - + freepages = 0; for (lcv = 0 ; lcv < vm_nphysseg ; lcv++) freepages += (vm_physmem[lcv].end - vm_physmem[lcv].start); @@ -253,13 +253,13 @@ uvm_page_init(vaddr_t *kvm_startp, vaddr_t *kvm_endp) * truncation errors (since we can only allocate in terms of whole * pages). */ - + pagecount = (((paddr_t)freepages + 1) << PAGE_SHIFT) / (PAGE_SIZE + sizeof(struct vm_page)); pagearray = (vm_page_t)uvm_pageboot_alloc(pagecount * sizeof(struct vm_page)); memset(pagearray, 0, pagecount * sizeof(struct vm_page)); - + /* * init the vm_page structures and put them in the correct place. */ @@ -342,9 +342,9 @@ uvm_page_init(vaddr_t *kvm_startp, vaddr_t *kvm_endp) /* * uvm_setpagesize: set the page size - * + * * => sets page_shift and page_mask from uvmexp.pagesize. - */ + */ void uvm_setpagesize(void) @@ -369,8 +369,8 @@ uvm_pageboot_alloc(vsize_t size) #if defined(PMAP_STEAL_MEMORY) vaddr_t addr; - /* - * defer bootstrap allocation to MD code (it may want to allocate + /* + * defer bootstrap allocation to MD code (it may want to allocate * from a direct-mapped segment). pmap_steal_memory should round * off virtual_space_start/virtual_space_end. */ @@ -874,7 +874,7 @@ uvm_pagealloc(struct uvm_object *obj, voff_t off, struct vm_anon *anon, use_reserve = (flags & UVM_PGA_USERESERVE) || (obj && UVM_OBJ_IS_KERN_OBJECT(obj)); if ((uvmexp.free <= uvmexp.reserve_kernel && !use_reserve) || - (uvmexp.free <= uvmexp.reserve_pagedaemon && + (uvmexp.free <= uvmexp.reserve_pagedaemon && !((curproc == uvm.pagedaemon_proc) || (curproc == syncerproc)))) goto fail; @@ -975,8 +975,8 @@ uvm_pagefree(struct vm_page *pg) * if the object page is on loan we are going to drop ownership. * it is possible that an anon will take over as owner for this * page later on. the anon will want a !PG_CLEAN page so that - * it knows it needs to allocate swap if it wants to page the - * page out. + * it knows it needs to allocate swap if it wants to page the + * page out. */ /* in case an anon takes over */ @@ -988,12 +988,12 @@ uvm_pagefree(struct vm_page *pg) * if our page was on loan, then we just lost control over it * (in fact, if it was loaned to an anon, the anon may have * already taken over ownership of the page by now and thus - * changed the loan_count [e.g. in uvmfault_anonget()]) we just - * return (when the last loan is dropped, then the page can be + * changed the loan_count [e.g. in uvmfault_anonget()]) we just + * return (when the last loan is dropped, then the page can be * freed by whatever was holding the last loan). */ - if (saved_loan_count) + if (saved_loan_count) return; } else if (saved_loan_count && pg->uanon) { /* @@ -1361,7 +1361,7 @@ uvm_pagewire(struct vm_page *pg) } /* - * uvm_pageunwire: unwire the page. + * uvm_pageunwire: unwire the page. * * => activate if wire count goes to zero. * => caller must lock page queues |