aboutsummaryrefslogtreecommitdiff
path: root/sys/vm
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2001-06-22 21:12:19 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2001-06-22 21:12:19 +0000
commit6d541bf1ae28d17d5dae35abe2a82ce1ac9ab411 (patch)
tree68b8f70d2008328fa143239c3a5ded0c841e5b1c /sys/vm
parent2f7f966cb853cdffbcf229c16ac879d954c18952 (diff)
Notes
Diffstat (limited to 'sys/vm')
-rw-r--r--sys/vm/swap_pager.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c
index 383863cd7557..edbfa8e7a86c 100644
--- a/sys/vm/swap_pager.c
+++ b/sys/vm/swap_pager.c
@@ -312,10 +312,12 @@ swap_pager_swap_init()
nsw_cluster_max = min((MAXPHYS/PAGE_SIZE), MAX_PAGEOUT_CLUSTER);
+ mtx_lock(&pbuf_mtx);
nsw_rcount = (nswbuf + 1) / 2;
nsw_wcount_sync = (nswbuf + 3) / 4;
nsw_wcount_async = 4;
nsw_wcount_async_max = nsw_wcount_async;
+ mtx_unlock(&pbuf_mtx);
/*
* Initialize our zone. Right now I'm just guessing on the number
@@ -1293,6 +1295,7 @@ swap_pager_putpages(object, m, count, sync, rtvals)
* Do not let the sysop crash the machine with bogus numbers.
*/
+ mtx_lock(&pbuf_mtx);
if (swap_async_max != nsw_wcount_async_max) {
int n;
int s;
@@ -1312,18 +1315,15 @@ swap_pager_putpages(object, m, count, sync, rtvals)
* at this time.
*/
s = splvm();
- mtx_unlock(&vm_mtx);
- mtx_lock(&pbuf_mtx);
n -= nsw_wcount_async_max;
if (nsw_wcount_async + n >= 0) {
nsw_wcount_async += n;
nsw_wcount_async_max += n;
wakeup(&nsw_wcount_async);
}
- mtx_unlock(&pbuf_mtx);
- mtx_lock(&vm_mtx);
splx(s);
}
+ mtx_unlock(&pbuf_mtx);
/*
* Step 3