diff options
author | alc <alc@FreeBSD.org> | 2002-07-07 19:27:57 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2002-07-07 19:27:57 +0000 |
commit | ffff9f17c5564d0b68bf6944ba87a9487bf1c0e4 (patch) | |
tree | aca26d5bf97d751109a7ca09d5aff8aa6d885973 /sys | |
parent | 499545477275c9a081c0b8177dc79b6b338179a1 (diff) | |
download | FreeBSD-src-ffff9f17c5564d0b68bf6944ba87a9487bf1c0e4.zip FreeBSD-src-ffff9f17c5564d0b68bf6944ba87a9487bf1c0e4.tar.gz |
o Lock accesses to the free queue(s) in vm_page_zero_idle().
Diffstat (limited to 'sys')
-rw-r--r-- | sys/vm/vm_zeroidle.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/vm/vm_zeroidle.c b/sys/vm/vm_zeroidle.c index d7ab1ce..0552c32 100644 --- a/sys/vm/vm_zeroidle.c +++ b/sys/vm/vm_zeroidle.c @@ -75,15 +75,18 @@ vm_page_zero_idle(void) vm_page_t m; mtx_lock(&Giant); + mtx_lock(&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); /* maybe drop out of Giant here */ pmap_zero_page(m); /* and return here */ + mtx_lock(&vm_page_queue_free_mtx); vm_page_flag_set(m, PG_ZERO); m->queue = PQ_FREE + m->pc; vm_page_queues[m->queue].lcnt++; @@ -95,6 +98,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(&Giant); return 1; } |