diff options
author | alc <alc@FreeBSD.org> | 2002-12-18 04:39:15 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2002-12-18 04:39:15 +0000 |
commit | 9fcc701ba3d678ef4d35c0bfbb884077ddeb37fe (patch) | |
tree | 971b7fde5b5fc14b6e0859976319df7989ea2f55 /sys/vm | |
parent | a0ec4e567056f7171d897a337bb918a3bdf26ddd (diff) | |
download | FreeBSD-src-9fcc701ba3d678ef4d35c0bfbb884077ddeb37fe.zip FreeBSD-src-9fcc701ba3d678ef4d35c0bfbb884077ddeb37fe.tar.gz |
- Hold the page queues lock when performing vm_page_busy().
- Replace vm_page_sleep_busy() with proper page queues locking
and vm_page_sleep_if_busy().
Diffstat (limited to 'sys/vm')
-rw-r--r-- | sys/vm/vm_object.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c index 22d462c..550b5d0 100644 --- a/sys/vm/vm_object.c +++ b/sys/vm/vm_object.c @@ -846,14 +846,15 @@ vm_object_page_collect_flush(vm_object_t object, vm_page_t p, int curgeneration, vm_page_t ma[vm_pageout_page_count]; s = splvm(); + vm_page_lock_queues(); pi = p->pindex; - while (vm_page_sleep_busy(p, TRUE, "vpcwai")) { + while (vm_page_sleep_if_busy(p, TRUE, "vpcwai")) { if (object->generation != curgeneration) { splx(s); return(0); } + vm_page_lock_queues(); } - vm_page_lock_queues(); maxf = 0; for(i = 1; i < vm_pageout_page_count; i++) { vm_page_t tp; @@ -1248,7 +1249,9 @@ vm_object_split(vm_map_entry_t entry) vm_page_unlock_queues(); vm_page_rename(m, new_object, idx); /* page automatically made dirty by rename and cache handled */ + vm_page_lock_queues(); vm_page_busy(m); + vm_page_unlock_queues(); } if (orig_object->type == OBJT_SWAP) { vm_object_pip_add(orig_object, 1); |