summaryrefslogtreecommitdiffstats
path: root/sys/fs/tmpfs
diff options
context:
space:
mode:
authorattilio <attilio@FreeBSD.org>2013-08-04 21:07:24 +0000
committerattilio <attilio@FreeBSD.org>2013-08-04 21:07:24 +0000
commit19b2ea9f815db5f4ef1071a79ee4f27a2a444a3f (patch)
tree66d78aa520f99833b11e6eca180f8fa7216b21f8 /sys/fs/tmpfs
parenta56cdf0d3470151f45842530ddf3cadef1d2819c (diff)
downloadFreeBSD-src-19b2ea9f815db5f4ef1071a79ee4f27a2a444a3f.zip
FreeBSD-src-19b2ea9f815db5f4ef1071a79ee4f27a2a444a3f.tar.gz
The page hold mechanism is fast but it has couple of fallouts:
- It does not let pages respect the LRU policy - It bloats the active/inactive queues of few pages Try to avoid it as much as possible with the long-term target to completely remove it. Use the soft-busy mechanism to protect page content accesses during short-term operations (like uiomove_fromphys()). After this change only vm_fault_quick_hold_pages() is still using the hold mechanism for page content access. There is an additional complexity there as the quick path cannot immediately access the page object to busy the page and the slow path cannot however busy more than one page a time (to avoid deadlocks). Fixing such primitive can bring to complete removal of the page hold mechanism. Sponsored by: EMC / Isilon storage division Discussed with: alc Reviewed by: jeff Tested by: pho
Diffstat (limited to 'sys/fs/tmpfs')
-rw-r--r--sys/fs/tmpfs/tmpfs_vnops.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/sys/fs/tmpfs/tmpfs_vnops.c b/sys/fs/tmpfs/tmpfs_vnops.c
index d867612..540eb7b 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_lock(m);
- vm_page_hold(m);
- vm_page_unlock(m);
+ vm_page_io_start(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,16 +602,14 @@ tmpfs_mappedwrite(vm_object_t tobj, size_t len, struct uio *uio)
vm_page_zero_invalid(tpg, TRUE);
vm_page_wakeup(tpg);
}
- vm_page_lock(tpg);
- vm_page_hold(tpg);
- vm_page_unlock(tpg);
+ vm_page_io_start(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 {
OpenPOWER on IntegriCloud