Page MenuHomeFreeBSD

D28807.diff
No OneTemporary

D28807.diff

Index: sys/vm/phys_pager.c
===================================================================
--- sys/vm/phys_pager.c
+++ sys/vm/phys_pager.c
@@ -180,8 +180,7 @@
for (i = 0; i < count; i++) {
if (vm_page_none_valid(m[i])) {
- if ((m[i]->flags & PG_ZERO) == 0)
- pmap_zero_page(m[i]);
+ pmap_zero_page(m[i]);
vm_page_valid(m[i]);
}
KASSERT(vm_page_all_valid(m[i]),
Index: sys/vm/vm_fault.c
===================================================================
--- sys/vm/vm_fault.c
+++ sys/vm/vm_fault.c
@@ -1034,14 +1034,7 @@
fs->m = fs->first_m;
fs->first_m = NULL;
- /*
- * Zero the page if necessary and mark it valid.
- */
- if ((fs->m->flags & PG_ZERO) == 0) {
- pmap_zero_page(fs->m);
- } else {
- VM_CNT_INC(v_ozfod);
- }
+ pmap_zero_page(fs->m);
VM_CNT_INC(v_zfod);
vm_page_valid(fs->m);
}
@@ -1092,6 +1085,9 @@
* Unlocked read of the p_flag is harmless. At worst, the P_KILLED
* might be not observed there, and allocation can fail, causing
* restart and new reading of the p_flag.
+ *
+ * The caller must be careful to zero the page if its contents are not
+ * provided by a pager.
*/
dset = fs->object->domain.dr_policy;
if (dset == NULL)
@@ -1102,9 +1098,6 @@
#endif
alloc_req = P_KILLED(curproc) ?
VM_ALLOC_SYSTEM : VM_ALLOC_NORMAL;
- if (fs->object->type != OBJT_VNODE &&
- fs->object->backing_object == NULL)
- alloc_req |= VM_ALLOC_ZERO;
fs->m = vm_page_alloc(fs->object, fs->pindex, alloc_req);
}
if (fs->m == NULL) {

File Metadata

Mime Type
text/plain
Expires
Fri, Nov 15, 10:37 PM (20 h, 47 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14649036
Default Alt Text
D28807.diff (1 KB)

Event Timeline