swap_pager.c (117722) | swap_pager.c (117723) |
---|---|
1/* 2 * Copyright (c) 1998 Matthew Dillon, 3 * Copyright (c) 1994 John S. Dyson 4 * Copyright (c) 1990 University of Utah. 5 * Copyright (c) 1982, 1986, 1989, 1993 6 * The Regents of the University of California. All rights reserved. 7 * 8 * This code is derived from software contributed to Berkeley by --- 53 unchanged lines hidden (view full) --- 62 * 63 * from: Utah $Hdr: swap_pager.c 1.4 91/04/30$ 64 * 65 * @(#)swap_pager.c 8.9 (Berkeley) 3/21/94 66 * @(#)vm_swap.c 8.5 (Berkeley) 2/17/94 67 */ 68 69#include <sys/cdefs.h> | 1/* 2 * Copyright (c) 1998 Matthew Dillon, 3 * Copyright (c) 1994 John S. Dyson 4 * Copyright (c) 1990 University of Utah. 5 * Copyright (c) 1982, 1986, 1989, 1993 6 * The Regents of the University of California. All rights reserved. 7 * 8 * This code is derived from software contributed to Berkeley by --- 53 unchanged lines hidden (view full) --- 62 * 63 * from: Utah $Hdr: swap_pager.c 1.4 91/04/30$ 64 * 65 * @(#)swap_pager.c 8.9 (Berkeley) 3/21/94 66 * @(#)vm_swap.c 8.5 (Berkeley) 2/17/94 67 */ 68 69#include <sys/cdefs.h> |
70__FBSDID("$FreeBSD: head/sys/vm/swap_pager.c 117722 2003-07-18 10:02:44Z phk $"); | 70__FBSDID("$FreeBSD: head/sys/vm/swap_pager.c 117723 2003-07-18 10:26:09Z phk $"); |
71 72#include "opt_mac.h" 73#include "opt_swap.h" 74#include "opt_vm.h" 75 76#include <sys/param.h> 77#include <sys/systm.h> 78#include <sys/conf.h> --- 58 unchanged lines hidden (view full) --- 137int swap_pager_full; /* swap space exhaustion (task killing) */ 138static int swap_pager_almost_full; /* swap space exhaustion (w/ hysteresis)*/ 139static int nsw_rcount; /* free read buffers */ 140static int nsw_wcount_sync; /* limit write buffers / synchronous */ 141static int nsw_wcount_async; /* limit write buffers / asynchronous */ 142static int nsw_wcount_async_max;/* assigned maximum */ 143static int nsw_cluster_max; /* maximum VOP I/O allowed */ 144 | 71 72#include "opt_mac.h" 73#include "opt_swap.h" 74#include "opt_vm.h" 75 76#include <sys/param.h> 77#include <sys/systm.h> 78#include <sys/conf.h> --- 58 unchanged lines hidden (view full) --- 137int swap_pager_full; /* swap space exhaustion (task killing) */ 138static int swap_pager_almost_full; /* swap space exhaustion (w/ hysteresis)*/ 139static int nsw_rcount; /* free read buffers */ 140static int nsw_wcount_sync; /* limit write buffers / synchronous */ 141static int nsw_wcount_async; /* limit write buffers / asynchronous */ 142static int nsw_wcount_async_max;/* assigned maximum */ 143static int nsw_cluster_max; /* maximum VOP I/O allowed */ 144 |
145struct blist *swapblist; | 145static struct blist *swapblist; |
146static struct swblock **swhash; 147static int swhash_mask; 148static int swap_async_max = 4; /* maximum in-progress async I/O's */ 149static struct sx sw_alloc_sx; 150 151 152SYSCTL_INT(_vm, OID_AUTO, swap_async_max, 153 CTLFLAG_RW, &swap_async_max, 0, "Maximum running async swap ops"); --- 2507 unchanged lines hidden (view full) --- 2661done: 2662 swdev_syscall_active = 0; 2663 wakeup_one(&swdev_syscall_active); 2664done2: 2665 mtx_unlock(&Giant); 2666 return (error); 2667} 2668 | 146static struct swblock **swhash; 147static int swhash_mask; 148static int swap_async_max = 4; /* maximum in-progress async I/O's */ 149static struct sx sw_alloc_sx; 150 151 152SYSCTL_INT(_vm, OID_AUTO, swap_async_max, 153 CTLFLAG_RW, &swap_async_max, 0, "Maximum running async swap ops"); --- 2507 unchanged lines hidden (view full) --- 2661done: 2662 swdev_syscall_active = 0; 2663 wakeup_one(&swdev_syscall_active); 2664done2: 2665 mtx_unlock(&Giant); 2666 return (error); 2667} 2668 |
2669void 2670swap_pager_status(int *total, int *used) 2671{ 2672 struct swdevt *sp; 2673 int i; 2674 2675 *total = 0; 2676 *used = 0; 2677 for (sp = swdevt, i = 0; i < nswdev; i++, sp++) { 2678 if (sp->sw_vp == NULL) 2679 continue; 2680 *total += sp->sw_nblks; 2681 *used += sp->sw_used; 2682 } 2683} 2684 |
|
2669static int 2670sysctl_vm_swap_info(SYSCTL_HANDLER_ARGS) 2671{ 2672 int *name = (int *)arg1; 2673 int error, i, n; 2674 struct xswdev xs; 2675 struct swdevt *sp; 2676 --- 26 unchanged lines hidden --- | 2685static int 2686sysctl_vm_swap_info(SYSCTL_HANDLER_ARGS) 2687{ 2688 int *name = (int *)arg1; 2689 int error, i, n; 2690 struct xswdev xs; 2691 struct swdevt *sp; 2692 --- 26 unchanged lines hidden --- |