Tue Sep 23 08:56:15 2008 UTC ()
Move test for __SWAP_BROKEN here.


(ad)
diff -r1.139 -r1.140 src/sys/uvm/uvm_swap.c

cvs diff -r1.139 -r1.140 src/sys/uvm/uvm_swap.c (expand / switch to unified diff)

--- src/sys/uvm/uvm_swap.c 2008/05/29 14:51:27 1.139
+++ src/sys/uvm/uvm_swap.c 2008/09/23 08:56:15 1.140
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: uvm_swap.c,v 1.139 2008/05/29 14:51:27 mrg Exp $ */ 1/* $NetBSD: uvm_swap.c,v 1.140 2008/09/23 08:56:15 ad Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1995, 1996, 1997 Matthew R. Green 4 * Copyright (c) 1995, 1996, 1997 Matthew R. Green
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -20,27 +20,27 @@ @@ -20,27 +20,27 @@
20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
21 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
23 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 23 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * SUCH DAMAGE. 26 * SUCH DAMAGE.
27 * 27 *
28 * from: NetBSD: vm_swap.c,v 1.52 1997/12/02 13:47:37 pk Exp 28 * from: NetBSD: vm_swap.c,v 1.52 1997/12/02 13:47:37 pk Exp
29 * from: Id: uvm_swap.c,v 1.1.2.42 1998/02/02 20:38:06 chuck Exp 29 * from: Id: uvm_swap.c,v 1.1.2.42 1998/02/02 20:38:06 chuck Exp
30 */ 30 */
31 31
32#include <sys/cdefs.h> 32#include <sys/cdefs.h>
33__KERNEL_RCSID(0, "$NetBSD: uvm_swap.c,v 1.139 2008/05/29 14:51:27 mrg Exp $"); 33__KERNEL_RCSID(0, "$NetBSD: uvm_swap.c,v 1.140 2008/09/23 08:56:15 ad Exp $");
34 34
35#include "fs_nfs.h" 35#include "fs_nfs.h"
36#include "opt_uvmhist.h" 36#include "opt_uvmhist.h"
37#include "opt_compat_netbsd.h" 37#include "opt_compat_netbsd.h"
38#include "opt_ddb.h" 38#include "opt_ddb.h"
39 39
40#include <sys/param.h> 40#include <sys/param.h>
41#include <sys/systm.h> 41#include <sys/systm.h>
42#include <sys/buf.h> 42#include <sys/buf.h>
43#include <sys/bufq.h> 43#include <sys/bufq.h>
44#include <sys/conf.h> 44#include <sys/conf.h>
45#include <sys/proc.h> 45#include <sys/proc.h>
46#include <sys/namei.h> 46#include <sys/namei.h>
@@ -265,27 +265,31 @@ uvm_swap_init(void) @@ -265,27 +265,31 @@ uvm_swap_init(void)
265 * from 1 to INT_MAX allows 2 gigablocks of swap space. note 265 * from 1 to INT_MAX allows 2 gigablocks of swap space. note
266 * that block 0 is reserved (used to indicate an allocation 266 * that block 0 is reserved (used to indicate an allocation
267 * failure, or no allocation). 267 * failure, or no allocation).
268 */ 268 */
269 swapmap = vmem_create("swapmap", 1, INT_MAX - 1, 1, NULL, NULL, NULL, 0, 269 swapmap = vmem_create("swapmap", 1, INT_MAX - 1, 1, NULL, NULL, NULL, 0,
270 VM_NOSLEEP, IPL_NONE); 270 VM_NOSLEEP, IPL_NONE);
271 if (swapmap == 0) 271 if (swapmap == 0)
272 panic("uvm_swap_init: extent_create failed"); 272 panic("uvm_swap_init: extent_create failed");
273 273
274 /* 274 /*
275 * done! 275 * done!
276 */ 276 */
277 uvm.swap_running = true; 277 uvm.swap_running = true;
 278#ifdef __SWAP_BROKEN
 279 uvm.swapout_enabled = 0;
 280#else
278 uvm.swapout_enabled = 1; 281 uvm.swapout_enabled = 1;
 282#endif
279 UVMHIST_LOG(pdhist, "<- done", 0, 0, 0, 0); 283 UVMHIST_LOG(pdhist, "<- done", 0, 0, 0, 0);
280 284
281 sysctl_createv(NULL, 0, NULL, NULL, 285 sysctl_createv(NULL, 0, NULL, NULL,
282 CTLFLAG_READWRITE, 286 CTLFLAG_READWRITE,
283 CTLTYPE_INT, "swapout", 287 CTLTYPE_INT, "swapout",
284 SYSCTL_DESCR("Set 0 to disable swapout of kernel stacks"), 288 SYSCTL_DESCR("Set 0 to disable swapout of kernel stacks"),
285 NULL, 0, &uvm.swapout_enabled, 0, CTL_VM, CTL_CREATE, CTL_EOL); 289 NULL, 0, &uvm.swapout_enabled, 0, CTL_VM, CTL_CREATE, CTL_EOL);
286} 290}
287 291
288/* 292/*
289 * swaplist functions: functions that operate on the list of swap 293 * swaplist functions: functions that operate on the list of swap
290 * devices on the system. 294 * devices on the system.
291 */ 295 */