MM: handle zero_at_free in page faults

Change-Id: Ib2b37c73936a365173d84a2a806a17374ccc05d4
This commit is contained in:
Balazs Gerofi
2021-03-03 14:42:57 +09:00
committed by Masamichi Takagi
parent 7d69f15101
commit c593faea89
2 changed files with 6 additions and 2 deletions

View File

@ -84,7 +84,9 @@ static int hugefileobj_get_page(struct memobj *memobj, off_t off,
goto out;
}
memset(obj->pages[pgind], 0, obj->pgsize);
if (!zero_at_free) {
memset(obj->pages[pgind], 0, obj->pgsize);
}
dkprintf("%s: obj: 0x%lx, allocated page for off: %lu"
" (ind: %d), page size: %lu\n",
__func__, obj, off, pgind, obj->pgsize);

View File

@ -2232,7 +2232,9 @@ retry:
#ifdef PROFILE_ENABLE
profile_event_add(PROFILE_page_fault_anon_clr, pgsize);
#endif // PROFILE_ENABLE
memset(virt, 0, pgsize);
if (!zero_at_free) {
memset(virt, 0, pgsize);
}
phys = virt_to_phys(virt);
if (phys_to_page(phys)) {
dkprintf("%s: NOPHYS,phys=%lx,vmr(%lx-%lx),flag=%x,fa=%lx,reason=%x\n",