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:
parent
2bfabe4196
commit
04f883d798
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=229363
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user