--- src/nvidia_subr.c.orig 2010-05-26 19:34:20.722118986 +0300 +++ src/nvidia_subr.c 2010-05-26 19:50:00.198768786 +0300 @@ -1237,6 +1237,7 @@ struct nvidia_alloc *at; struct nvidia_softc *sc = nv->os_state; vm_offset_t address; + vm_page_t m; uint32_t i; vm_memattr_t attr; uint32_t size = (count * PAGE_SIZE); @@ -1301,9 +1302,10 @@ for (i = 0; i < count; i++) { pte_array[i] = at->pte_array[i].physical_address; - vm_page_lock_queues(); - vm_page_wire(PHYS_TO_VM_PAGE(pte_array[i])); - vm_page_unlock_queues(); + m = PHYS_TO_VM_PAGE(pte_array[i]); + vm_page_lock(m); + vm_page_wire(m); + vm_page_unlock(m); sglist_append_phys(at->sg_list, pte_array[i], PAGE_SIZE); } @@ -1365,9 +1367,7 @@ os_flush_cpu_cache(); for (i = 0; i < count; i++) { - vm_page_lock_queues(); vm_page_unwire(PHYS_TO_VM_PAGE(at->pte_array[i].physical_address), 0); - vm_page_unlock_queues(); kmem_free(kernel_map, at->pte_array[i].virtual_address, PAGE_SIZE); malloc_type_freed(M_NVIDIA, PAGE_SIZE);