add a `flags' argument to uvm_pagealloc_strat().
define a flag UVM_PGA_USERESERVE to allow non-kernel object allocations to use pages from the reserve. use the new flag for allocations in pmap modules.
This commit is contained in:
parent
39b90701da
commit
f455dd6596
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: machdep.c,v 1.167 1999/04/10 01:21:37 cgd Exp $ */
|
||||
/* $NetBSD: machdep.c,v 1.168 1999/04/11 04:04:04 chs Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||
@ -82,7 +82,7 @@
|
||||
|
||||
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
|
||||
|
||||
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.167 1999/04/10 01:21:37 cgd Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.168 1999/04/11 04:04:04 chs Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -1064,7 +1064,7 @@ cpu_startup()
|
||||
curbufsize = CLBYTES * ((i < residual) ? (base+1) : base);
|
||||
|
||||
while (curbufsize) {
|
||||
pg = uvm_pagealloc(NULL, 0, NULL);
|
||||
pg = uvm_pagealloc(NULL, 0, NULL, 0);
|
||||
if (pg == NULL)
|
||||
panic("cpu_startup: not enough memory for "
|
||||
"buffer cache");
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: pmap.c,v 1.90 1999/04/10 01:21:37 cgd Exp $ */
|
||||
/* $NetBSD: pmap.c,v 1.91 1999/04/11 04:04:05 chs Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
|
||||
@ -155,7 +155,7 @@
|
||||
|
||||
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
|
||||
|
||||
__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.90 1999/04/10 01:21:37 cgd Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.91 1999/04/11 04:04:05 chs Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -3291,7 +3291,7 @@ pmap_physpage_alloc(usage)
|
||||
try = 0; /* try a few times, but give up eventually */
|
||||
|
||||
do {
|
||||
pg = uvm_pagealloc(NULL, 0, NULL);
|
||||
pg = uvm_pagealloc(NULL, 0, NULL, UVM_PGA_USERESERVE);
|
||||
if (pg != NULL) {
|
||||
pa = VM_PAGE_TO_PHYS(pg);
|
||||
pmap_zero_page(pa);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: machdep.c,v 1.133 1999/04/01 00:17:46 thorpej Exp $ */
|
||||
/* $NetBSD: machdep.c,v 1.134 1999/04/11 04:04:05 chs Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1988 University of Utah.
|
||||
@ -406,7 +406,7 @@ again:
|
||||
curbufsize = CLBYTES * ((i < residual) ? (base+1) : base);
|
||||
|
||||
while (curbufsize) {
|
||||
pg = uvm_pagealloc(NULL, 0, NULL);
|
||||
pg = uvm_pagealloc(NULL, 0, NULL, 0);
|
||||
if (pg == NULL)
|
||||
panic("cpu_startup: not enough memory for "
|
||||
"buffer cache");
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: machdep.c,v 1.65 1999/04/01 00:17:46 thorpej Exp $ */
|
||||
/* $NetBSD: machdep.c,v 1.66 1999/04/11 04:04:05 chs Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994-1998 Mark Brinicombe.
|
||||
@ -451,7 +451,7 @@ cpu_startup()
|
||||
curbufsize = CLBYTES * ((loop < residual) ? (base+1) : base);
|
||||
|
||||
while (curbufsize) {
|
||||
pg = uvm_pagealloc(NULL, 0, NULL);
|
||||
pg = uvm_pagealloc(NULL, 0, NULL, 0);
|
||||
if (pg == NULL)
|
||||
panic("cpu_startup: not enough memory for buffer cache");
|
||||
pmap_enter(kernel_map->pmap, curbuf,
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: pmap.c,v 1.59 1999/03/30 20:59:52 mycroft Exp $ */
|
||||
/* $NetBSD: pmap.c,v 1.60 1999/04/11 04:04:06 chs Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1999 The NetBSD Foundation, Inc.
|
||||
@ -2062,7 +2062,7 @@ pmap_enter(pmap, va, pa, prot, wired, access_type)
|
||||
|
||||
/* Allocate a page table */
|
||||
for (;;) {
|
||||
m = uvm_pagealloc(NULL, 0, NULL);
|
||||
m = uvm_pagealloc(NULL, 0, NULL, UVM_PGA_USERESERVE);
|
||||
if (m != NULL)
|
||||
break;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: machdep.c,v 1.79 1999/04/01 00:17:46 thorpej Exp $ */
|
||||
/* $NetBSD: machdep.c,v 1.80 1999/04/11 04:04:06 chs Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1988 University of Utah.
|
||||
@ -348,7 +348,7 @@ again:
|
||||
curbufsize = CLBYTES * ((i < residual) ? (base+1) : base);
|
||||
|
||||
while (curbufsize) {
|
||||
pg = uvm_pagealloc(NULL, 0, NULL);
|
||||
pg = uvm_pagealloc(NULL, 0, NULL, 0);
|
||||
if (pg == NULL)
|
||||
panic("cpu_startup: not enough memory for "
|
||||
"buffer cache");
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: machdep.c,v 1.33 1999/04/01 00:17:46 thorpej Exp $ */
|
||||
/* $NetBSD: machdep.c,v 1.34 1999/04/11 04:04:06 chs Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
|
||||
@ -515,7 +515,7 @@ cpu_startup()
|
||||
curbufsize = CLBYTES * ((i < residual) ? (base+1) : base);
|
||||
|
||||
while (curbufsize) {
|
||||
pg = uvm_pagealloc(NULL, 0, NULL);
|
||||
pg = uvm_pagealloc(NULL, 0, NULL, 0);
|
||||
if (pg == NULL)
|
||||
panic("startup: not enough memory for "
|
||||
"buffer cache");
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: machdep.c,v 1.122 1999/04/01 00:17:47 thorpej Exp $ */
|
||||
/* $NetBSD: machdep.c,v 1.123 1999/04/11 04:04:06 chs Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1988 University of Utah.
|
||||
@ -348,7 +348,7 @@ cpu_startup()
|
||||
curbufsize = CLBYTES * ((i < residual) ? (base+1) : base);
|
||||
|
||||
while (curbufsize) {
|
||||
pg = uvm_pagealloc(NULL, 0, NULL);
|
||||
pg = uvm_pagealloc(NULL, 0, NULL, 0);
|
||||
if (pg == NULL)
|
||||
panic("cpu_startup: not enough memory for "
|
||||
"buffer cache");
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: machdep.c,v 1.349 1999/04/01 00:37:50 thorpej Exp $ */
|
||||
/* $NetBSD: machdep.c,v 1.350 1999/04/11 04:04:07 chs Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
|
||||
@ -592,7 +592,7 @@ i386_bufinit()
|
||||
* 16M of RAM to avoid bouncing file system
|
||||
* transfers.
|
||||
*/
|
||||
pg = uvm_pagealloc_strat(NULL, 0, NULL,
|
||||
pg = uvm_pagealloc_strat(NULL, 0, NULL, 0,
|
||||
UVM_PGA_STRAT_FALLBACK, VM_FREELIST_FIRST16);
|
||||
if (pg == NULL)
|
||||
panic("cpu_startup: not enough memory for "
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: pmap.new.c,v 1.23 1999/03/26 23:41:30 mycroft Exp $ */
|
||||
/* $NetBSD: pmap.new.c,v 1.24 1999/04/11 04:04:07 chs Exp $ */
|
||||
|
||||
/*
|
||||
*
|
||||
@ -1163,7 +1163,7 @@ int mode;
|
||||
}
|
||||
|
||||
pg = uvm_pagealloc(uvmexp.kmem_object, pv_cachedva - vm_map_min(kernel_map),
|
||||
NULL);
|
||||
NULL, UVM_PGA_USERESERVE);
|
||||
if (pg)
|
||||
pg->flags &= ~PG_BUSY; /* never busy */
|
||||
|
||||
@ -1573,8 +1573,8 @@ boolean_t just_try;
|
||||
{
|
||||
struct vm_page *ptp;
|
||||
|
||||
ptp = uvm_pagealloc(&pmap->pm_obj, ptp_i2o(pde_index), NULL);
|
||||
|
||||
ptp = uvm_pagealloc(&pmap->pm_obj, ptp_i2o(pde_index), NULL,
|
||||
UVM_PGA_USERESERVE);
|
||||
if (ptp == NULL) {
|
||||
if (just_try)
|
||||
return(NULL);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: machdep.c,v 1.228 1999/04/07 06:45:15 scottr Exp $ */
|
||||
/* $NetBSD: machdep.c,v 1.229 1999/04/11 04:04:07 chs Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1988 University of Utah.
|
||||
@ -519,7 +519,7 @@ again:
|
||||
curbufsize = CLBYTES * ((i < residual) ? (base+1) : base);
|
||||
|
||||
while (curbufsize) {
|
||||
pg = uvm_pagealloc(NULL, 0, NULL);
|
||||
pg = uvm_pagealloc(NULL, 0, NULL, 0);
|
||||
if (pg == NULL)
|
||||
panic("cpu_startup: not enough memory for "
|
||||
"buffer cache");
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: machdep.c,v 1.38 1999/04/01 00:17:47 thorpej Exp $ */
|
||||
/* $NetBSD: machdep.c,v 1.39 1999/04/11 04:04:08 chs Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
|
||||
@ -524,7 +524,7 @@ cpu_startup()
|
||||
curbufsize = CLBYTES * (i < residual ? base + 1 : base);
|
||||
|
||||
while (curbufsize) {
|
||||
pg = uvm_pagealloc(NULL, 0, NULL);
|
||||
pg = uvm_pagealloc(NULL, 0, NULL, 0);
|
||||
if (pg == NULL)
|
||||
panic("cpu_startup: not enough memory for "
|
||||
"buffer cache");
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: machdep.c,v 1.52 1999/04/01 00:17:48 thorpej Exp $ */
|
||||
/* $NetBSD: machdep.c,v 1.53 1999/04/11 04:04:08 chs Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1988 University of Utah.
|
||||
@ -447,7 +447,7 @@ cpu_startup()
|
||||
curbufsize = CLBYTES * ((i < residual) ? (base+1) : base);
|
||||
|
||||
while (curbufsize) {
|
||||
pg = uvm_pagealloc(NULL, 0, NULL);
|
||||
pg = uvm_pagealloc(NULL, 0, NULL, 0);
|
||||
if (pg == NULL)
|
||||
panic("cpu_startup: not enough memory for "
|
||||
"buffer cache");
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: machdep.c,v 1.24 1999/04/01 00:17:48 thorpej Exp $ */
|
||||
/* $NetBSD: machdep.c,v 1.25 1999/04/11 04:04:08 chs Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1988 University of Utah.
|
||||
@ -43,7 +43,7 @@
|
||||
|
||||
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
|
||||
|
||||
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.24 1999/04/01 00:17:48 thorpej Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.25 1999/04/11 04:04:08 chs Exp $");
|
||||
|
||||
/* from: Utah Hdr: machdep.c 1.63 91/04/24 */
|
||||
|
||||
@ -372,7 +372,7 @@ cpu_startup()
|
||||
curbufsize = CLBYTES * ((i < residual) ? (base+1) : base);
|
||||
|
||||
while (curbufsize) {
|
||||
pg = uvm_pagealloc(NULL, 0, NULL);
|
||||
pg = uvm_pagealloc(NULL, 0, NULL, 0);
|
||||
if (pg == NULL)
|
||||
panic("cpu_startup: not enough memory for "
|
||||
"buffer cache");
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: machdep.c,v 1.19 1999/04/01 00:17:48 thorpej Exp $ */
|
||||
/* $NetBSD: machdep.c,v 1.20 1999/04/11 04:04:08 chs Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1988 University of Utah.
|
||||
@ -389,7 +389,7 @@ cpu_startup()
|
||||
curbufsize = CLBYTES * ((i < residual) ? (base+1) : base);
|
||||
|
||||
while (curbufsize) {
|
||||
pg = uvm_pagealloc(NULL, 0, NULL);
|
||||
pg = uvm_pagealloc(NULL, 0, NULL, 0);
|
||||
if (pg == NULL)
|
||||
panic("cpu_startup: not enough memory for "
|
||||
"buffer cache");
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: machdep.c,v 1.35 1999/04/01 00:17:48 thorpej Exp $ */
|
||||
/* $NetBSD: machdep.c,v 1.36 1999/04/11 04:04:08 chs Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
|
||||
@ -429,7 +429,7 @@ cpu_startup()
|
||||
curbufsize = CLBYTES * ((i < residual) ? (base+1) : base);
|
||||
|
||||
while (curbufsize) {
|
||||
pg = uvm_pagealloc(NULL, 0, NULL);
|
||||
pg = uvm_pagealloc(NULL, 0, NULL, 0);
|
||||
if (pg == NULL)
|
||||
panic("startup: not enough memory for "
|
||||
"buffer cache");
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: machdep.c,v 1.96 1999/04/01 00:17:48 thorpej Exp $ */
|
||||
/* $NetBSD: machdep.c,v 1.97 1999/04/11 04:04:09 chs Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1996 Matthias Pfaller.
|
||||
@ -294,7 +294,7 @@ cpu_startup()
|
||||
curbufsize = CLBYTES * ((i < residual) ? (base+1) : base);
|
||||
|
||||
while (curbufsize) {
|
||||
pg = uvm_pagealloc(NULL, 0, NULL);
|
||||
pg = uvm_pagealloc(NULL, 0, NULL, 0);
|
||||
if (pg == NULL)
|
||||
panic("cpu_startup: not enough memory for "
|
||||
"buffer cache");
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: pmap.new.c,v 1.10 1999/03/26 23:41:33 mycroft Exp $ */
|
||||
/* $NetBSD: pmap.new.c,v 1.11 1999/04/11 04:04:09 chs Exp $ */
|
||||
|
||||
/*
|
||||
*
|
||||
@ -1074,7 +1074,7 @@ int mode;
|
||||
}
|
||||
|
||||
pg = uvm_pagealloc(uvmexp.kmem_object, pv_cachedva - vm_map_min(kernel_map),
|
||||
NULL);
|
||||
NULL, UVM_PGA_USERESERVE);
|
||||
if (pg)
|
||||
pg->flags &= ~PG_BUSY; /* never busy */
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: machdep.c,v 1.134 1999/04/01 00:17:49 thorpej Exp $ */
|
||||
/* $NetBSD: machdep.c,v 1.135 1999/04/11 04:04:09 chs Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1988 University of Utah.
|
||||
@ -43,7 +43,7 @@
|
||||
|
||||
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
|
||||
|
||||
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.134 1999/04/01 00:17:49 thorpej Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.135 1999/04/11 04:04:09 chs Exp $");
|
||||
|
||||
/* from: Utah Hdr: machdep.c 1.63 91/04/24 */
|
||||
|
||||
@ -566,7 +566,7 @@ cpu_startup()
|
||||
curbufsize = CLBYTES * ((i < residual) ? (base+1) : base);
|
||||
|
||||
while (curbufsize) {
|
||||
pg = uvm_pagealloc(NULL, 0, NULL);
|
||||
pg = uvm_pagealloc(NULL, 0, NULL, 0);
|
||||
if (pg == NULL)
|
||||
panic("cpu_startup: not enough memory for "
|
||||
"buffer cache");
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: pmap.c,v 1.19 1999/03/26 23:41:34 mycroft Exp $ */
|
||||
/* $NetBSD: pmap.c,v 1.20 1999/04/11 04:04:09 chs Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
|
||||
@ -823,7 +823,7 @@ poalloc()
|
||||
* Since we cannot use maps for potable allocation,
|
||||
* we have to steal some memory from the VM system. XXX
|
||||
*/
|
||||
mem = uvm_pagealloc(NULL, 0, NULL);
|
||||
mem = uvm_pagealloc(NULL, 0, NULL, UVM_PGA_USERESERVE);
|
||||
po_pcnt++;
|
||||
pop = (struct po_page *)VM_PAGE_TO_PHYS(mem);
|
||||
pop->pop_pgi.pgi_page = mem;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: machdep.c,v 1.143 1999/04/01 00:17:49 thorpej Exp $ */
|
||||
/* $NetBSD: machdep.c,v 1.144 1999/04/11 04:04:09 chs Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
|
||||
@ -274,7 +274,7 @@ cpu_startup()
|
||||
curbufsize = CLBYTES * ((i < residual) ? (base+1) : base);
|
||||
|
||||
while (curbufsize) {
|
||||
pg = uvm_pagealloc(NULL, 0, NULL);
|
||||
pg = uvm_pagealloc(NULL, 0, NULL, 0);
|
||||
if (pg == NULL)
|
||||
panic("cpu_startup: "
|
||||
"not enough RAM for buffer cache");
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: machdep.c,v 1.36 1999/04/01 00:17:49 thorpej Exp $ */
|
||||
/* $NetBSD: machdep.c,v 1.37 1999/04/11 04:04:10 chs Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
|
||||
@ -258,7 +258,7 @@ cpu_startup()
|
||||
curbufsize = CLBYTES * ((i < residual) ? (base+1) : base);
|
||||
|
||||
while (curbufsize) {
|
||||
pg = uvm_pagealloc(NULL, 0, NULL);
|
||||
pg = uvm_pagealloc(NULL, 0, NULL, 0);
|
||||
if (pg == NULL)
|
||||
panic("cpu_startup: "
|
||||
"not enough RAM for buffer cache");
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: pmap.c,v 1.31 1999/03/28 19:01:03 eeh Exp $ */
|
||||
/* $NetBSD: pmap.c,v 1.32 1999/04/11 04:04:10 chs Exp $ */
|
||||
/* #define NO_VCACHE */ /* Don't forget the locked TLB in dostart */
|
||||
#define HWREF
|
||||
/* #define BOOT_DEBUG */
|
||||
@ -3343,7 +3343,7 @@ vm_page_t
|
||||
vm_page_alloc1()
|
||||
{
|
||||
#if 1
|
||||
return uvm_pagealloc(NULL,0,NULL);
|
||||
return uvm_pagealloc(NULL, 0, NULL, UVM_PGA_USERESERVE);
|
||||
#else
|
||||
register vm_page_t mem;
|
||||
int spl;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: machdep.c,v 1.126 1999/04/08 04:17:43 gwr Exp $ */
|
||||
/* $NetBSD: machdep.c,v 1.127 1999/04/11 04:04:10 chs Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994, 1995 Gordon W. Ross
|
||||
@ -347,7 +347,7 @@ cpu_startup()
|
||||
curbufsize = CLBYTES * ((i < residual) ? (base+1) : base);
|
||||
|
||||
while (curbufsize) {
|
||||
pg = uvm_pagealloc(NULL, 0, NULL);
|
||||
pg = uvm_pagealloc(NULL, 0, NULL, 0);
|
||||
if (pg == NULL)
|
||||
panic("cpu_startup: not enough memory for "
|
||||
"buffer cache");
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: machdep.c,v 1.46 1999/04/08 04:17:44 gwr Exp $ */
|
||||
/* $NetBSD: machdep.c,v 1.47 1999/04/11 04:04:10 chs Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1988 University of Utah.
|
||||
@ -342,7 +342,7 @@ cpu_startup()
|
||||
curbufsize = CLBYTES * ((i < residual) ? (base+1) : base);
|
||||
|
||||
while (curbufsize) {
|
||||
pg = uvm_pagealloc(NULL, 0, NULL);
|
||||
pg = uvm_pagealloc(NULL, 0, NULL, 0);
|
||||
if (pg == NULL)
|
||||
panic("cpu_startup: not enough memory for "
|
||||
"buffer cache");
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: machdep.c,v 1.76 1999/04/01 00:17:50 thorpej Exp $ */
|
||||
/* $NetBSD: machdep.c,v 1.77 1999/04/11 04:04:10 chs Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994, 1998 Ludd, University of Lule}, Sweden.
|
||||
@ -256,7 +256,7 @@ cpu_startup()
|
||||
curbuf = (vm_offset_t) buffers + i * MAXBSIZE;
|
||||
curbufsize = CLBYTES * (i < residual ? base + 1 : base);
|
||||
while (curbufsize) {
|
||||
pg = uvm_pagealloc(NULL, 0, NULL);
|
||||
pg = uvm_pagealloc(NULL, 0, NULL, 0);
|
||||
if (pg == NULL)
|
||||
panic("cpu_startup: "
|
||||
"not enough RAM for buffer cache");
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: machdep.c,v 1.60 1999/04/01 00:17:50 thorpej Exp $ */
|
||||
/* $NetBSD: machdep.c,v 1.61 1999/04/11 04:04:11 chs Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1988 University of Utah.
|
||||
@ -425,7 +425,7 @@ again:
|
||||
curbufsize = CLBYTES * ((i < residual) ? (base+1) : base);
|
||||
|
||||
while (curbufsize) {
|
||||
pg = uvm_pagealloc(NULL, 0, NULL);
|
||||
pg = uvm_pagealloc(NULL, 0, NULL, 0);
|
||||
if (pg == NULL)
|
||||
panic("cpu_startup: not enough memory for "
|
||||
"buffer cache");
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: uvm_amap.c,v 1.19 1999/01/28 14:46:27 chuck Exp $ */
|
||||
/* $NetBSD: uvm_amap.c,v 1.20 1999/04/11 04:04:11 chs Exp $ */
|
||||
|
||||
/*
|
||||
*
|
||||
@ -796,7 +796,7 @@ ReStart:
|
||||
*/
|
||||
nanon = uvm_analloc();
|
||||
if (nanon)
|
||||
npg = uvm_pagealloc(NULL, 0, nanon);
|
||||
npg = uvm_pagealloc(NULL, 0, nanon, 0);
|
||||
else
|
||||
npg = NULL; /* XXX: quiet gcc warning */
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: uvm_aobj.c,v 1.18 1999/03/26 17:34:15 chs Exp $ */
|
||||
/* $NetBSD: uvm_aobj.c,v 1.19 1999/04/11 04:04:11 chs Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1998 Chuck Silvers, Charles D. Cranor and
|
||||
@ -801,7 +801,7 @@ uao_get(uobj, offset, pps, npagesp, centeridx, access_type, advice, flags)
|
||||
if (ptmp == NULL && uao_find_swslot(aobj,
|
||||
current_offset >> PAGE_SHIFT) == 0) {
|
||||
ptmp = uvm_pagealloc(uobj, current_offset,
|
||||
NULL);
|
||||
NULL, 0);
|
||||
if (ptmp) {
|
||||
/* new page */
|
||||
ptmp->flags &= ~(PG_BUSY|PG_FAKE);
|
||||
@ -891,7 +891,7 @@ uao_get(uobj, offset, pps, npagesp, centeridx, access_type, advice, flags)
|
||||
if (ptmp == NULL) {
|
||||
|
||||
ptmp = uvm_pagealloc(uobj, current_offset,
|
||||
NULL); /* alloc */
|
||||
NULL, 0);
|
||||
|
||||
/* out of RAM? */
|
||||
if (ptmp == NULL) {
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: uvm_extern.h,v 1.23 1999/03/26 17:34:15 chs Exp $ */
|
||||
/* $NetBSD: uvm_extern.h,v 1.24 1999/04/11 04:04:11 chs Exp $ */
|
||||
|
||||
/*
|
||||
*
|
||||
@ -118,7 +118,6 @@
|
||||
/*
|
||||
* the following defines are for uvm_km_kmemalloc's flags
|
||||
*/
|
||||
|
||||
#define UVM_KMF_NOWAIT 0x1 /* matches M_NOWAIT */
|
||||
#define UVM_KMF_VALLOC 0x2 /* allocate VA only */
|
||||
#define UVM_KMF_TRYLOCK UVM_FLAG_TRYLOCK /* try locking only */
|
||||
@ -130,6 +129,11 @@
|
||||
#define UVM_PGA_STRAT_ONLY 1 /* only specified free list */
|
||||
#define UVM_PGA_STRAT_FALLBACK 2 /* ONLY falls back on NORMAL */
|
||||
|
||||
/*
|
||||
* flags for uvm_pagealloc_strat()
|
||||
*/
|
||||
#define UVM_PGA_USERESERVE 0x0001
|
||||
|
||||
/*
|
||||
* structures
|
||||
*/
|
||||
@ -340,9 +344,10 @@ int uvm_mmap __P((vm_map_t, vaddr_t *, vsize_t,
|
||||
|
||||
/* uvm_page.c */
|
||||
struct vm_page *uvm_pagealloc_strat __P((struct uvm_object *,
|
||||
vaddr_t, struct vm_anon *, int, int));
|
||||
#define uvm_pagealloc(obj, off, anon) \
|
||||
uvm_pagealloc_strat((obj), (off), (anon), UVM_PGA_STRAT_NORMAL, 0)
|
||||
vaddr_t, struct vm_anon *, int, int, int));
|
||||
#define uvm_pagealloc(obj, off, anon, flags) \
|
||||
uvm_pagealloc_strat((obj), (off), (anon), (flags), \
|
||||
UVM_PGA_STRAT_NORMAL, 0)
|
||||
void uvm_pagerealloc __P((struct vm_page *,
|
||||
struct uvm_object *, vaddr_t));
|
||||
/* Actually, uvm_page_physload takes PF#s which need their own type */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: uvm_fault.c,v 1.27 1999/03/29 05:43:31 mycroft Exp $ */
|
||||
/* $NetBSD: uvm_fault.c,v 1.28 1999/04/11 04:04:11 chs Exp $ */
|
||||
|
||||
/*
|
||||
*
|
||||
@ -375,7 +375,7 @@ int uvmfault_anonget(ufi, amap, anon)
|
||||
/*
|
||||
* no page, we must try and bring it in.
|
||||
*/
|
||||
pg = uvm_pagealloc(NULL, 0, anon);
|
||||
pg = uvm_pagealloc(NULL, 0, anon, 0);
|
||||
|
||||
if (pg == NULL) { /* out of RAM. */
|
||||
|
||||
@ -1074,7 +1074,7 @@ ReFault:
|
||||
if (anon->an_ref == 1) {
|
||||
|
||||
/* get new un-owned replacement page */
|
||||
pg = uvm_pagealloc(NULL, 0, NULL);
|
||||
pg = uvm_pagealloc(NULL, 0, NULL, 0);
|
||||
if (pg == NULL) {
|
||||
uvmfault_unlockall(&ufi, amap, uobj,
|
||||
anon);
|
||||
@ -1137,7 +1137,7 @@ ReFault:
|
||||
oanon = anon; /* oanon = old, locked anon */
|
||||
anon = uvm_analloc();
|
||||
if (anon)
|
||||
pg = uvm_pagealloc(NULL, 0, anon);
|
||||
pg = uvm_pagealloc(NULL, 0, anon, 0);
|
||||
#ifdef __GNUC__
|
||||
else
|
||||
pg = NULL; /* XXX: gcc */
|
||||
@ -1434,7 +1434,7 @@ Case2:
|
||||
/* write fault: must break the loan here */
|
||||
|
||||
/* alloc new un-owned page */
|
||||
pg = uvm_pagealloc(NULL, 0, NULL);
|
||||
pg = uvm_pagealloc(NULL, 0, NULL, 0);
|
||||
|
||||
if (pg == NULL) {
|
||||
/*
|
||||
@ -1515,7 +1515,7 @@ Case2:
|
||||
|
||||
anon = uvm_analloc();
|
||||
if (anon)
|
||||
pg = uvm_pagealloc(NULL, 0, anon); /* BUSY+CLEAN+FAKE */
|
||||
pg = uvm_pagealloc(NULL, 0, anon, 0);
|
||||
#ifdef __GNUC__
|
||||
else
|
||||
pg = NULL; /* XXX: gcc */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: uvm_km.c,v 1.22 1999/03/26 21:58:39 mycroft Exp $ */
|
||||
/* $NetBSD: uvm_km.c,v 1.23 1999/04/11 04:04:11 chs Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1997 Charles D. Cranor and Washington University.
|
||||
@ -244,7 +244,7 @@ uvm_km_get(uobj, offset, pps, npagesp, centeridx, access_type, advice, flags)
|
||||
/* null? attempt to allocate the page */
|
||||
if (ptmp == NULL) {
|
||||
ptmp = uvm_pagealloc(uobj, current_offset,
|
||||
NULL);
|
||||
NULL, 0);
|
||||
if (ptmp) {
|
||||
/* new page */
|
||||
ptmp->flags &= ~(PG_BUSY|PG_FAKE);
|
||||
@ -334,7 +334,7 @@ uvm_km_get(uobj, offset, pps, npagesp, centeridx, access_type, advice, flags)
|
||||
if (ptmp == NULL) {
|
||||
|
||||
ptmp = uvm_pagealloc(uobj, current_offset,
|
||||
NULL); /* alloc */
|
||||
NULL, 0);
|
||||
|
||||
/* out of RAM? */
|
||||
if (ptmp == NULL) {
|
||||
@ -700,7 +700,7 @@ uvm_km_kmemalloc(map, obj, size, flags)
|
||||
loopva = kva;
|
||||
while (size) {
|
||||
simple_lock(&obj->vmobjlock);
|
||||
pg = uvm_pagealloc(obj, offset, NULL);
|
||||
pg = uvm_pagealloc(obj, offset, NULL, 0);
|
||||
if (pg) {
|
||||
pg->flags &= ~PG_BUSY; /* new page */
|
||||
UVM_PAGE_OWN(pg, NULL);
|
||||
@ -849,7 +849,7 @@ uvm_km_alloc1(map, size, zeroit)
|
||||
}
|
||||
|
||||
/* allocate ram */
|
||||
pg = uvm_pagealloc(uvm.kernel_object, offset, NULL);
|
||||
pg = uvm_pagealloc(uvm.kernel_object, offset, NULL, 0);
|
||||
if (pg) {
|
||||
pg->flags &= ~PG_BUSY; /* new page */
|
||||
UVM_PAGE_OWN(pg, NULL);
|
||||
@ -1000,7 +1000,7 @@ uvm_km_alloc_poolpage1(map, obj, waitok)
|
||||
vaddr_t va;
|
||||
|
||||
again:
|
||||
pg = uvm_pagealloc(NULL, 0, NULL);
|
||||
pg = uvm_pagealloc(NULL, 0, NULL, 0);
|
||||
if (pg == NULL) {
|
||||
if (waitok) {
|
||||
uvm_wait("plpg");
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: uvm_loan.c,v 1.14 1999/03/25 18:48:52 mrg Exp $ */
|
||||
/* $NetBSD: uvm_loan.c,v 1.15 1999/04/11 04:04:11 chs Exp $ */
|
||||
|
||||
/*
|
||||
*
|
||||
@ -610,7 +610,7 @@ uvm_loanzero(ufi, output, flags)
|
||||
|
||||
if ((flags & UVM_LOAN_TOANON) == 0) { /* loaning to kernel-page */
|
||||
|
||||
while ((pg = uvm_pagealloc(NULL, 0, NULL)) == NULL) {
|
||||
while ((pg = uvm_pagealloc(NULL, 0, NULL, 0)) == NULL) {
|
||||
uvmfault_unlockall(ufi, ufi->entry->aref.ar_amap,
|
||||
ufi->entry->object.uvm_obj, NULL);
|
||||
uvm_wait("loanzero1");
|
||||
@ -640,7 +640,7 @@ uvm_loanzero(ufi, output, flags)
|
||||
|
||||
/* loaning to an anon */
|
||||
while ((anon = uvm_analloc()) == NULL ||
|
||||
(pg = uvm_pagealloc(NULL, 0, anon)) == NULL) {
|
||||
(pg = uvm_pagealloc(NULL, 0, anon, 0)) == NULL) {
|
||||
|
||||
/* unlock everything */
|
||||
uvmfault_unlockall(ufi, ufi->entry->aref.ar_amap,
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: uvm_page.c,v 1.17 1999/03/26 21:58:39 mycroft Exp $ */
|
||||
/* $NetBSD: uvm_page.c,v 1.18 1999/04/11 04:04:11 chs Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1997 Charles D. Cranor and Washington University.
|
||||
@ -810,15 +810,17 @@ uvm_page_physdump()
|
||||
*/
|
||||
|
||||
struct vm_page *
|
||||
uvm_pagealloc_strat(obj, off, anon, strat, free_list)
|
||||
uvm_pagealloc_strat(obj, off, anon, flags, strat, free_list)
|
||||
struct uvm_object *obj;
|
||||
vaddr_t off;
|
||||
int flags;
|
||||
struct vm_anon *anon;
|
||||
int strat, free_list;
|
||||
{
|
||||
int lcv, s;
|
||||
struct vm_page *pg;
|
||||
struct pglist *freeq;
|
||||
boolean_t use_reserve;
|
||||
|
||||
#ifdef DIAGNOSTIC
|
||||
/* sanity check */
|
||||
@ -848,10 +850,11 @@ uvm_pagealloc_strat(obj, off, anon, strat, free_list)
|
||||
* the requestor isn't the pagedaemon.
|
||||
*/
|
||||
|
||||
if ((uvmexp.free <= uvmexp.reserve_kernel &&
|
||||
!(obj && obj->uo_refs == UVM_OBJ_KERN)) ||
|
||||
use_reserve = (flags & UVM_PGA_USERESERVE) ||
|
||||
(obj && obj->uo_refs == UVM_OBJ_KERN);
|
||||
if ((uvmexp.free <= uvmexp.reserve_kernel && !use_reserve) ||
|
||||
(uvmexp.free <= uvmexp.reserve_pagedaemon &&
|
||||
!(obj == uvmexp.kmem_object && curproc == uvm.pagedaemon_proc)))
|
||||
!(use_reserve && curproc == uvm.pagedaemon_proc)))
|
||||
goto fail;
|
||||
|
||||
again:
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: uvm_vnode.c,v 1.22 1999/03/25 18:48:56 mrg Exp $ */
|
||||
/* $NetBSD: uvm_vnode.c,v 1.23 1999/04/11 04:04:11 chs Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1997 Charles D. Cranor and Washington University.
|
||||
@ -1455,7 +1455,7 @@ uvn_get(uobj, offset, pps, npagesp, centeridx, access_type, advice, flags)
|
||||
if (ptmp == NULL) {
|
||||
|
||||
ptmp = uvm_pagealloc(uobj, current_offset,
|
||||
NULL); /* alloc */
|
||||
NULL, 0);
|
||||
|
||||
/* out of RAM? */
|
||||
if (ptmp == NULL) {
|
||||
|
Loading…
Reference in New Issue
Block a user