aboutsummaryrefslogtreecommitdiff
path: root/sys/fs
diff options
context:
space:
mode:
authorAttilio Rao <attilio@FreeBSD.org>2013-08-05 08:55:35 +0000
committerAttilio Rao <attilio@FreeBSD.org>2013-08-05 08:55:35 +0000
commitbe9968363742a7b369819f598be0d2f08f1c92ab (patch)
tree668bc05fd597966d485deb8ea05c427ee434fde6 /sys/fs
parent41541ebf942a1a6d07d2c309701df8b38adb8d73 (diff)
downloadsrc-be9968363742a7b369819f598be0d2f08f1c92ab.tar.gz
src-be9968363742a7b369819f598be0d2f08f1c92ab.zip
Revert r253939:
We cannot busy a page before doing pagefaults. Infact, it can deadlock against vnode lock, as it tries to vget(). Other functions, right now, have an opposite lock ordering, like vm_object_sync(), which acquires the vnode lock first and then sleeps on the busy mechanism. Before this patch is reinserted we need to break this ordering. Sponsored by: EMC / Isilon storage division Reported by: kib
Notes
Notes: svn path=/head/; revision=253953
Diffstat (limited to 'sys/fs')
-rw-r--r--sys/fs/tmpfs/tmpfs_vnops.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/sys/fs/tmpfs/tmpfs_vnops.c b/sys/fs/tmpfs/tmpfs_vnops.c
index 540eb7b41c7b..d867612a7bd2 100644
--- a/sys/fs/tmpfs/tmpfs_vnops.c
+++ b/sys/fs/tmpfs/tmpfs_vnops.c
@@ -485,13 +485,13 @@ tmpfs_nocacheread(vm_object_t tobj, vm_pindex_t idx,
vm_page_zero_invalid(m, TRUE);
vm_page_wakeup(m);
}
- vm_page_io_start(m);
+ vm_page_lock(m);
+ vm_page_hold(m);
+ vm_page_unlock(m);
VM_OBJECT_WUNLOCK(tobj);
error = uiomove_fromphys(&m, offset, tlen, uio);
- VM_OBJECT_WLOCK(tobj);
- vm_page_io_finish(m);
- VM_OBJECT_WUNLOCK(tobj);
vm_page_lock(m);
+ vm_page_unhold(m);
if (m->queue == PQ_NONE) {
vm_page_deactivate(m);
} else {
@@ -602,14 +602,16 @@ tmpfs_mappedwrite(vm_object_t tobj, size_t len, struct uio *uio)
vm_page_zero_invalid(tpg, TRUE);
vm_page_wakeup(tpg);
}
- vm_page_io_start(tpg);
+ vm_page_lock(tpg);
+ vm_page_hold(tpg);
+ vm_page_unlock(tpg);
VM_OBJECT_WUNLOCK(tobj);
error = uiomove_fromphys(&tpg, offset, tlen, uio);
VM_OBJECT_WLOCK(tobj);
- vm_page_io_finish(tpg);
if (error == 0)
vm_page_dirty(tpg);
vm_page_lock(tpg);
+ vm_page_unhold(tpg);
if (tpg->queue == PQ_NONE) {
vm_page_deactivate(tpg);
} else {