Don't pass VM_ALLOC_ZERO to vm_page_grab() in tmpfs_mappedwrite() and

tmpfs_nocacheread().  It is both unnecessary and a pessimization.  It
results in either the page being zeroed twice or zeroed first and then
overwritten by an I/O operation.

MFC after:	3 weeks
This commit is contained in:
alc 2012-01-03 03:29:01 +00:00
parent 6b69dce993
commit 9976fae042

View File

@ -442,7 +442,7 @@ tmpfs_nocacheread(vm_object_t tobj, vm_pindex_t idx,
VM_OBJECT_LOCK(tobj);
vm_object_pip_add(tobj, 1);
m = vm_page_grab(tobj, idx, VM_ALLOC_WIRED |
VM_ALLOC_ZERO | VM_ALLOC_NORMAL | VM_ALLOC_RETRY);
VM_ALLOC_NORMAL | VM_ALLOC_RETRY);
if (m->valid != VM_PAGE_BITS_ALL) {
if (vm_pager_has_page(tobj, idx, NULL, NULL)) {
error = vm_pager_get_pages(tobj, &m, 1, 0);
@ -666,7 +666,7 @@ tmpfs_mappedwrite(vm_object_t vobj, vm_object_t tobj, size_t len, struct uio *ui
VM_OBJECT_LOCK(tobj);
vm_object_pip_add(tobj, 1);
tpg = vm_page_grab(tobj, idx, VM_ALLOC_WIRED |
VM_ALLOC_ZERO | VM_ALLOC_NORMAL | VM_ALLOC_RETRY);
VM_ALLOC_NORMAL | VM_ALLOC_RETRY);
if (tpg->valid != VM_PAGE_BITS_ALL) {
if (vm_pager_has_page(tobj, idx, NULL, NULL)) {
error = vm_pager_get_pages(tobj, &tpg, 1, 0);