diff options
author | alc <alc@FreeBSD.org> | 2002-08-02 18:55:29 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2002-08-02 18:55:29 +0000 |
commit | 86e3f5101f74c9ab6e2082b6159e00042b34b733 (patch) | |
tree | 8d24a71a19a43f4610d610c3d0454084ba0a133e /sys | |
parent | 7f3d1cc63ff8d5fe9824e474a6126f8d0ca0df08 (diff) | |
download | FreeBSD-src-86e3f5101f74c9ab6e2082b6159e00042b34b733.zip FreeBSD-src-86e3f5101f74c9ab6e2082b6159e00042b34b733.tar.gz |
o Convert two instances of vm_page_sleep_busy() into vm_page_sleep_if_busy()
with appropriate page queue locking.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/vm/vm_object.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c index 7f6a788..a4353d9 100644 --- a/sys/vm/vm_object.c +++ b/sys/vm/vm_object.c @@ -1260,10 +1260,12 @@ vm_object_split(vm_map_entry_t entry) * We do not have to VM_PROT_NONE the page as mappings should * not be changed by this operation. */ - if (vm_page_sleep_busy(m, TRUE, "spltwt")) + vm_page_lock_queues(); + if (vm_page_sleep_if_busy(m, TRUE, "spltwt")) goto retry; vm_page_busy(m); + vm_page_unlock_queues(); vm_page_rename(m, new_object, idx); /* page automatically made dirty by rename and cache handled */ vm_page_busy(m); @@ -1379,19 +1381,19 @@ vm_object_backing_scan(vm_object_t object, int op) if (op & (OBSC_COLLAPSE_WAIT | OBSC_COLLAPSE_NOWAIT)) { vm_page_t pp; + vm_page_lock_queues(); if (op & OBSC_COLLAPSE_NOWAIT) { - if ( - (p->flags & PG_BUSY) || + if ((p->flags & PG_BUSY) || !p->valid || p->hold_count || p->wire_count || - p->busy - ) { + p->busy) { + vm_page_unlock_queues(); p = next; continue; } } else if (op & OBSC_COLLAPSE_WAIT) { - if (vm_page_sleep_busy(p, TRUE, "vmocol")) { + if (vm_page_sleep_if_busy(p, TRUE, "vmocol")) { /* * If we slept, anything could have * happened. Since the object is @@ -1408,6 +1410,7 @@ vm_object_backing_scan(vm_object_t object, int op) * Busy the page */ vm_page_busy(p); + vm_page_unlock_queues(); KASSERT( p->object == backing_object, |