summaryrefslogtreecommitdiffstats
path: root/sys/vm/vm_zeroidle.c
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2002-07-08 23:12:37 +0000
committerpeter <peter@FreeBSD.org>2002-07-08 23:12:37 +0000
commit770030e6792e027444cdb7d8d43aa5c8c3cb9d94 (patch)
tree78f1b5dbfe506ea8578f36f1c1967f47a00f9195 /sys/vm/vm_zeroidle.c
parent94af63d2929b9e49d515cfdd378857924a912071 (diff)
downloadFreeBSD-src-770030e6792e027444cdb7d8d43aa5c8c3cb9d94.zip
FreeBSD-src-770030e6792e027444cdb7d8d43aa5c8c3cb9d94.tar.gz
vm_page_queue_free_mtx is a spin mutex, not a normal sleep mutex.
I do not know why this didn't panic my box, but I have most certainly been using it: peter@overcee[3:14pm]~src/sys/i386/i386-110> sysctl -a | grep zero vm.stats.misc.zero_page_count: 2235 vm.stats.misc.cnt_prezero: 638951 vm.idlezero_enable: 1 vm.idlezero_maxrun: 16 Submitted by: Tor.Egge@cvsup.no.freebsd.org Approved by: Tor's patches are never wrong. :-)
Diffstat (limited to 'sys/vm/vm_zeroidle.c')
-rw-r--r--sys/vm/vm_zeroidle.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/vm/vm_zeroidle.c b/sys/vm/vm_zeroidle.c
index 31a332c..bf35c80 100644
--- a/sys/vm/vm_zeroidle.c
+++ b/sys/vm/vm_zeroidle.c
@@ -79,18 +79,18 @@ vm_page_zero_idle(void)
vm_page_t m;
mtx_lock(&Giant);
- mtx_lock(&vm_page_queue_free_mtx);
+ mtx_lock_spin(&vm_page_queue_free_mtx);
zero_state = 0;
m = vm_pageq_find(PQ_FREE, free_rover, FALSE);
if (m != NULL && (m->flags & PG_ZERO) == 0) {
vm_page_queues[m->queue].lcnt--;
TAILQ_REMOVE(&vm_page_queues[m->queue].pl, m, pageq);
m->queue = PQ_NONE;
- mtx_unlock(&vm_page_queue_free_mtx);
+ mtx_unlock_spin(&vm_page_queue_free_mtx);
mtx_unlock(&Giant);
pmap_zero_page_idle(m);
mtx_lock(&Giant);
- mtx_lock(&vm_page_queue_free_mtx);
+ mtx_lock_spin(&vm_page_queue_free_mtx);
vm_page_flag_set(m, PG_ZERO);
m->queue = PQ_FREE + m->pc;
vm_page_queues[m->queue].lcnt++;
@@ -102,7 +102,7 @@ vm_page_zero_idle(void)
zero_state = 1;
}
free_rover = (free_rover + PQ_PRIME2) & PQ_L2_MASK;
- mtx_unlock(&vm_page_queue_free_mtx);
+ mtx_unlock_spin(&vm_page_queue_free_mtx);
mtx_unlock(&Giant);
return 1;
}
OpenPOWER on IntegriCloud