kernel - Wait for I/O to finish in vm_object_terminate()
authorMatthew Dillon <dillon@apollo.backplane.com>
Fri, 11 Nov 2011 03:42:59 +0000 (19:42 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Fri, 11 Nov 2011 03:42:59 +0000 (19:42 -0800)
* It is possible for swap I/O to be in progress when terminating a VM
  object, wait for any such I/O to complete before attempting to free
  the page.

* Fixes a panic which can occur under heavy loads.

Reported-by: John Marino
sys/vm/vm_object.c

index cc2fd00..85e2a33 100644 (file)
@@ -850,7 +850,7 @@ vm_object_terminate_callback(vm_page_t p, void *data __unused)
        vm_object_t object;
 
        object = p->object;
-       vm_page_busy_wait(p, FALSE, "vmpgtrm");
+       vm_page_busy_wait(p, TRUE, "vmpgtrm");
        if (object != p->object) {
                kprintf("vm_object_terminate: Warning: Encountered "
                        "busied page %p on queue %d\n", p, p->queue);