diff options
author | alc <alc@FreeBSD.org> | 2003-06-08 23:01:24 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2003-06-08 23:01:24 +0000 |
commit | 6a3f0ec4b167d9c70d2ebb7162083405840f5846 (patch) | |
tree | 3aed428160716098870494822e370dd09161a2ee /sys/vm/vm_object.c | |
parent | c0f54c22355d6ab852d7120f29b5a310b075ae60 (diff) | |
download | FreeBSD-src-6a3f0ec4b167d9c70d2ebb7162083405840f5846.zip FreeBSD-src-6a3f0ec4b167d9c70d2ebb7162083405840f5846.tar.gz |
- Properly handle the paging_in_progress case on two vm objects in
vm_object_deallocate().
- Remove vm_object_pip_sleep().
Diffstat (limited to 'sys/vm/vm_object.c')
-rw-r--r-- | sys/vm/vm_object.c | 42 |
1 files changed, 16 insertions, 26 deletions
diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c index 0822462..f406368 100644 --- a/sys/vm/vm_object.c +++ b/sys/vm/vm_object.c @@ -109,7 +109,6 @@ SYSCTL_INT(_vm, OID_AUTO, msync_flush_flags, static void vm_object_qcollapse(vm_object_t object); static int vm_object_page_collect_flush(vm_object_t object, vm_page_t p, int curgeneration, int pagerflags); -static void vm_object_pip_sleep(vm_object_t object, char *waitid); /* * Virtual memory objects maintain the actual data @@ -310,20 +309,6 @@ vm_object_pip_wakeupn(vm_object_t object, short i) } } -static void -vm_object_pip_sleep(vm_object_t object, char *waitid) -{ - GIANT_REQUIRED; - if (object->paging_in_progress) { - int s = splvm(); - if (object->paging_in_progress) { - vm_object_set_flag(object, OBJ_PIPWNT); - tsleep(object, PVM, waitid, 0); - } - splx(s); - } -} - void vm_object_pip_wait(vm_object_t object, char *waitid) { @@ -489,17 +474,22 @@ vm_object_deallocate(vm_object_t object) robject->type == OBJT_SWAP)) { robject->ref_count++; - - while ( - robject->paging_in_progress || - object->paging_in_progress - ) { - /* XXX */ VM_OBJECT_UNLOCK(object); - /* XXX */ VM_OBJECT_UNLOCK(robject); - vm_object_pip_sleep(robject, "objde1"); - vm_object_pip_sleep(object, "objde2"); - /* XXX */ VM_OBJECT_LOCK(robject); - /* XXX */ VM_OBJECT_LOCK(object); +retry: + if (robject->paging_in_progress) { + VM_OBJECT_UNLOCK(object); + vm_object_pip_wait(robject, + "objde1"); + VM_OBJECT_LOCK(object); + goto retry; + } else if (object->paging_in_progress) { + VM_OBJECT_UNLOCK(robject); + object->flags |= OBJ_PIPWNT; + msleep(object, + VM_OBJECT_MTX(object), + PDROP | PVM, "objde2", 0); + VM_OBJECT_LOCK(robject); + VM_OBJECT_LOCK(object); + goto retry; } VM_OBJECT_UNLOCK(object); if (robject->ref_count == 1) { |