summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2002-08-04 19:05:20 +0000
committeralc <alc@FreeBSD.org>2002-08-04 19:05:20 +0000
commit93773deb7bebbf93ff78c91ac7737768b324d499 (patch)
treebe92559b300d587370d6602ce5fdbb218991aa20 /sys
parentf6b60fe5036c1f6bee419dad2c1a960607bd18b6 (diff)
downloadFreeBSD-src-93773deb7bebbf93ff78c91ac7737768b324d499.zip
FreeBSD-src-93773deb7bebbf93ff78c91ac7737768b324d499.tar.gz
o Acquire the page queues lock before checking the page's busy status
in vm_page_grab(). Also, replace the nearby tsleep() with an msleep() on the page queues lock.
Diffstat (limited to 'sys')
-rw-r--r--sys/vm/vm_page.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c
index 5d61668..91da256 100644
--- a/sys/vm/vm_page.c
+++ b/sys/vm/vm_page.c
@@ -1542,6 +1542,7 @@ vm_page_grab(vm_object_t object, vm_pindex_t pindex, int allocflags)
GIANT_REQUIRED;
retrylookup:
if ((m = vm_page_lookup(object, pindex)) != NULL) {
+ vm_page_lock_queues();
if (m->busy || (m->flags & PG_BUSY)) {
generation = object->generation;
@@ -1549,16 +1550,17 @@ retrylookup:
while ((object->generation == generation) &&
(m->busy || (m->flags & PG_BUSY))) {
vm_page_flag_set(m, PG_WANTED | PG_REFERENCED);
- tsleep(m, PVM, "pgrbwt", 0);
+ msleep(m, &vm_page_queue_mtx, PVM, "pgrbwt", 0);
if ((allocflags & VM_ALLOC_RETRY) == 0) {
+ vm_page_unlock_queues();
splx(s);
return NULL;
}
}
+ vm_page_unlock_queues();
splx(s);
goto retrylookup;
} else {
- vm_page_lock_queues();
if (allocflags & VM_ALLOC_WIRED)
vm_page_wire(m);
vm_page_busy(m);
OpenPOWER on IntegriCloud