diff options
author | alc <alc@FreeBSD.org> | 2013-06-06 06:17:20 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2013-06-06 06:17:20 +0000 |
commit | e60ab9c72d61f9ec88a4887e299551d7c3234907 (patch) | |
tree | 3a1e174973dd48f9da2206c49f231a4b36111937 /sys/fs | |
parent | 38a637b8a0c41db72b88be9e4e6962f2981be080 (diff) | |
download | FreeBSD-src-e60ab9c72d61f9ec88a4887e299551d7c3234907.zip FreeBSD-src-e60ab9c72d61f9ec88a4887e299551d7c3234907.tar.gz |
Don't busy the page unless we are likely to release the object lock.
Reviewed by: kib
Sponsored by: EMC / Isilon Storage Division
Diffstat (limited to 'sys/fs')
-rw-r--r-- | sys/fs/tmpfs/tmpfs_vnops.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/fs/tmpfs/tmpfs_vnops.c b/sys/fs/tmpfs/tmpfs_vnops.c index 1b66620..970714e 100644 --- a/sys/fs/tmpfs/tmpfs_vnops.c +++ b/sys/fs/tmpfs/tmpfs_vnops.c @@ -460,8 +460,9 @@ tmpfs_nocacheread(vm_object_t tobj, vm_pindex_t idx, * type object. */ m = vm_page_grab(tobj, idx, VM_ALLOC_NORMAL | VM_ALLOC_RETRY | - VM_ALLOC_IGN_SBUSY); + VM_ALLOC_IGN_SBUSY | VM_ALLOC_NOBUSY); if (m->valid != VM_PAGE_BITS_ALL) { + vm_page_busy(m); if (vm_pager_has_page(tobj, idx, NULL, NULL)) { rv = vm_pager_get_pages(tobj, &m, 1, 0); m = vm_page_lookup(tobj, idx); @@ -483,10 +484,10 @@ tmpfs_nocacheread(vm_object_t tobj, vm_pindex_t idx, } } else vm_page_zero_invalid(m, TRUE); + vm_page_wakeup(m); } vm_page_lock(m); vm_page_hold(m); - vm_page_wakeup(m); vm_page_unlock(m); VM_OBJECT_WUNLOCK(tobj); error = uiomove_fromphys(&m, offset, tlen, uio); @@ -574,8 +575,10 @@ tmpfs_mappedwrite(vm_object_t tobj, size_t len, struct uio *uio) tlen = MIN(PAGE_SIZE - offset, len); VM_OBJECT_WLOCK(tobj); - tpg = vm_page_grab(tobj, idx, VM_ALLOC_NORMAL | VM_ALLOC_RETRY); + tpg = vm_page_grab(tobj, idx, VM_ALLOC_NORMAL | VM_ALLOC_NOBUSY | + VM_ALLOC_RETRY); if (tpg->valid != VM_PAGE_BITS_ALL) { + vm_page_busy(tpg); if (vm_pager_has_page(tobj, idx, NULL, NULL)) { rv = vm_pager_get_pages(tobj, &tpg, 1, 0); tpg = vm_page_lookup(tobj, idx); @@ -597,10 +600,10 @@ tmpfs_mappedwrite(vm_object_t tobj, size_t len, struct uio *uio) } } else vm_page_zero_invalid(tpg, TRUE); + vm_page_wakeup(tpg); } vm_page_lock(tpg); vm_page_hold(tpg); - vm_page_wakeup(tpg); vm_page_unlock(tpg); VM_OBJECT_WUNLOCK(tobj); error = uiomove_fromphys(&tpg, offset, tlen, uio); |