diff --git a/sys/arch/alpha/alpha/machdep.c b/sys/arch/alpha/alpha/machdep.c index 7654c41f40ef..3d941d16cf8e 100644 --- a/sys/arch/alpha/alpha/machdep.c +++ b/sys/arch/alpha/alpha/machdep.c @@ -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 /* 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 #include @@ -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"); diff --git a/sys/arch/alpha/alpha/pmap.c b/sys/arch/alpha/alpha/pmap.c index dfef2bca2c9a..d59378f80fb0 100644 --- a/sys/arch/alpha/alpha/pmap.c +++ b/sys/arch/alpha/alpha/pmap.c @@ -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 /* 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 #include @@ -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); diff --git a/sys/arch/amiga/amiga/machdep.c b/sys/arch/amiga/amiga/machdep.c index d93980ccb456..8e276a1ee344 100644 --- a/sys/arch/amiga/amiga/machdep.c +++ b/sys/arch/amiga/amiga/machdep.c @@ -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"); diff --git a/sys/arch/arm32/arm32/machdep.c b/sys/arch/arm32/arm32/machdep.c index 208201eefdad..80b14f381529 100644 --- a/sys/arch/arm32/arm32/machdep.c +++ b/sys/arch/arm32/arm32/machdep.c @@ -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, diff --git a/sys/arch/arm32/arm32/pmap.c b/sys/arch/arm32/arm32/pmap.c index 98fd4d42a617..14da56c5ea60 100644 --- a/sys/arch/arm32/arm32/pmap.c +++ b/sys/arch/arm32/arm32/pmap.c @@ -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; diff --git a/sys/arch/atari/atari/machdep.c b/sys/arch/atari/atari/machdep.c index dc66b1385fab..13dabffdfd00 100644 --- a/sys/arch/atari/atari/machdep.c +++ b/sys/arch/atari/atari/machdep.c @@ -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"); diff --git a/sys/arch/bebox/bebox/machdep.c b/sys/arch/bebox/bebox/machdep.c index 92f2a4a74259..6331f3d521ff 100644 --- a/sys/arch/bebox/bebox/machdep.c +++ b/sys/arch/bebox/bebox/machdep.c @@ -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"); diff --git a/sys/arch/hp300/hp300/machdep.c b/sys/arch/hp300/hp300/machdep.c index 24bfa2e9f2e6..fd56a36a1337 100644 --- a/sys/arch/hp300/hp300/machdep.c +++ b/sys/arch/hp300/hp300/machdep.c @@ -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"); diff --git a/sys/arch/i386/i386/machdep.c b/sys/arch/i386/i386/machdep.c index 46eca11138ed..44c527413a12 100644 --- a/sys/arch/i386/i386/machdep.c +++ b/sys/arch/i386/i386/machdep.c @@ -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 " diff --git a/sys/arch/i386/i386/pmap.new.c b/sys/arch/i386/i386/pmap.new.c index 3ac1b95ec83c..249d5ba1d63a 100644 --- a/sys/arch/i386/i386/pmap.new.c +++ b/sys/arch/i386/i386/pmap.new.c @@ -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); diff --git a/sys/arch/mac68k/mac68k/machdep.c b/sys/arch/mac68k/mac68k/machdep.c index f2c128d7db38..61157ba2152f 100644 --- a/sys/arch/mac68k/mac68k/machdep.c +++ b/sys/arch/mac68k/mac68k/machdep.c @@ -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"); diff --git a/sys/arch/macppc/macppc/machdep.c b/sys/arch/macppc/macppc/machdep.c index 8141cc1531d4..cb04d1abae8f 100644 --- a/sys/arch/macppc/macppc/machdep.c +++ b/sys/arch/macppc/macppc/machdep.c @@ -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"); diff --git a/sys/arch/mvme68k/mvme68k/machdep.c b/sys/arch/mvme68k/mvme68k/machdep.c index 4285e1eca6c0..9797bc878a7d 100644 --- a/sys/arch/mvme68k/mvme68k/machdep.c +++ b/sys/arch/mvme68k/mvme68k/machdep.c @@ -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"); diff --git a/sys/arch/newsmips/newsmips/machdep.c b/sys/arch/newsmips/newsmips/machdep.c index 94e611b6ce3a..42e27906d65f 100644 --- a/sys/arch/newsmips/newsmips/machdep.c +++ b/sys/arch/newsmips/newsmips/machdep.c @@ -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 /* 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"); diff --git a/sys/arch/next68k/next68k/machdep.c b/sys/arch/next68k/next68k/machdep.c index b8009462302c..dce59ef26d80 100644 --- a/sys/arch/next68k/next68k/machdep.c +++ b/sys/arch/next68k/next68k/machdep.c @@ -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"); diff --git a/sys/arch/ofppc/ofppc/machdep.c b/sys/arch/ofppc/ofppc/machdep.c index 5159ed129177..64de054fea14 100644 --- a/sys/arch/ofppc/ofppc/machdep.c +++ b/sys/arch/ofppc/ofppc/machdep.c @@ -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"); diff --git a/sys/arch/pc532/pc532/machdep.c b/sys/arch/pc532/pc532/machdep.c index 68e50a3da6b9..57b78d803253 100644 --- a/sys/arch/pc532/pc532/machdep.c +++ b/sys/arch/pc532/pc532/machdep.c @@ -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"); diff --git a/sys/arch/pc532/pc532/pmap.new.c b/sys/arch/pc532/pc532/pmap.new.c index b90edeaad0a3..1bb0f0b11186 100644 --- a/sys/arch/pc532/pc532/pmap.new.c +++ b/sys/arch/pc532/pc532/pmap.new.c @@ -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 */ diff --git a/sys/arch/pmax/pmax/machdep.c b/sys/arch/pmax/pmax/machdep.c index bc247352a5d6..d76fbe910167 100644 --- a/sys/arch/pmax/pmax/machdep.c +++ b/sys/arch/pmax/pmax/machdep.c @@ -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 /* 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"); diff --git a/sys/arch/powerpc/powerpc/pmap.c b/sys/arch/powerpc/powerpc/pmap.c index 178b143f5156..22e05352ddf2 100644 --- a/sys/arch/powerpc/powerpc/pmap.c +++ b/sys/arch/powerpc/powerpc/pmap.c @@ -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; diff --git a/sys/arch/sparc/sparc/machdep.c b/sys/arch/sparc/sparc/machdep.c index 8ba31b96b54f..8deb10adc504 100644 --- a/sys/arch/sparc/sparc/machdep.c +++ b/sys/arch/sparc/sparc/machdep.c @@ -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"); diff --git a/sys/arch/sparc64/sparc64/machdep.c b/sys/arch/sparc64/sparc64/machdep.c index 494c7a26af27..eba428371a40 100644 --- a/sys/arch/sparc64/sparc64/machdep.c +++ b/sys/arch/sparc64/sparc64/machdep.c @@ -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"); diff --git a/sys/arch/sparc64/sparc64/pmap.c b/sys/arch/sparc64/sparc64/pmap.c index 046888c00a3f..cb68492c1a2e 100644 --- a/sys/arch/sparc64/sparc64/pmap.c +++ b/sys/arch/sparc64/sparc64/pmap.c @@ -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; diff --git a/sys/arch/sun3/sun3/machdep.c b/sys/arch/sun3/sun3/machdep.c index 70c7e969d5a2..600907fdce4d 100644 --- a/sys/arch/sun3/sun3/machdep.c +++ b/sys/arch/sun3/sun3/machdep.c @@ -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"); diff --git a/sys/arch/sun3/sun3x/machdep.c b/sys/arch/sun3/sun3x/machdep.c index 15a08bf88a22..2d1b1df0e92c 100644 --- a/sys/arch/sun3/sun3x/machdep.c +++ b/sys/arch/sun3/sun3x/machdep.c @@ -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"); diff --git a/sys/arch/vax/vax/machdep.c b/sys/arch/vax/vax/machdep.c index 44b710519740..057cb7c3ca94 100644 --- a/sys/arch/vax/vax/machdep.c +++ b/sys/arch/vax/vax/machdep.c @@ -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"); diff --git a/sys/arch/x68k/x68k/machdep.c b/sys/arch/x68k/x68k/machdep.c index e199c75e135c..bd3bf1d74b14 100644 --- a/sys/arch/x68k/x68k/machdep.c +++ b/sys/arch/x68k/x68k/machdep.c @@ -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"); diff --git a/sys/uvm/uvm_amap.c b/sys/uvm/uvm_amap.c index 2e0ec2d4b7ef..1d596a703f99 100644 --- a/sys/uvm/uvm_amap.c +++ b/sys/uvm/uvm_amap.c @@ -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 */ diff --git a/sys/uvm/uvm_aobj.c b/sys/uvm/uvm_aobj.c index c2bed7b58c3d..3c124f4dc8bc 100644 --- a/sys/uvm/uvm_aobj.c +++ b/sys/uvm/uvm_aobj.c @@ -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) { diff --git a/sys/uvm/uvm_extern.h b/sys/uvm/uvm_extern.h index 4fc29f908eee..d2371b2670c6 100644 --- a/sys/uvm/uvm_extern.h +++ b/sys/uvm/uvm_extern.h @@ -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 */ diff --git a/sys/uvm/uvm_fault.c b/sys/uvm/uvm_fault.c index 1d8b103ecbf0..252ef342bfb7 100644 --- a/sys/uvm/uvm_fault.c +++ b/sys/uvm/uvm_fault.c @@ -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 */ diff --git a/sys/uvm/uvm_km.c b/sys/uvm/uvm_km.c index dfed570eac9c..12d6d3b697f0 100644 --- a/sys/uvm/uvm_km.c +++ b/sys/uvm/uvm_km.c @@ -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"); diff --git a/sys/uvm/uvm_loan.c b/sys/uvm/uvm_loan.c index fdb000f4b06f..319d81908945 100644 --- a/sys/uvm/uvm_loan.c +++ b/sys/uvm/uvm_loan.c @@ -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, diff --git a/sys/uvm/uvm_page.c b/sys/uvm/uvm_page.c index 9dc2e5982bb6..631a67ea889c 100644 --- a/sys/uvm/uvm_page.c +++ b/sys/uvm/uvm_page.c @@ -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: diff --git a/sys/uvm/uvm_vnode.c b/sys/uvm/uvm_vnode.c index 5e8d6652b437..2f96fd833800 100644 --- a/sys/uvm/uvm_vnode.c +++ b/sys/uvm/uvm_vnode.c @@ -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) {