svn commit: r229363 - head/sys/fs/tmpfs
Alan Cox
alc at FreeBSD.org
Tue Jan 3 03:29:01 UTC 2012
Author: alc
Date: Tue Jan 3 03:29:01 2012
New Revision: 229363
URL: http://svn.freebsd.org/changeset/base/229363
Log:
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
Modified:
head/sys/fs/tmpfs/tmpfs_vnops.c
Modified: head/sys/fs/tmpfs/tmpfs_vnops.c
==============================================================================
--- head/sys/fs/tmpfs/tmpfs_vnops.c Tue Jan 3 01:07:02 2012 (r229362)
+++ head/sys/fs/tmpfs/tmpfs_vnops.c Tue Jan 3 03:29:01 2012 (r229363)
@@ -442,7 +442,7 @@ tmpfs_nocacheread(vm_object_t tobj, vm_p
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 @@ nocache:
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);
More information about the svn-src-head
mailing list