do_mmap(): indicate user level allocations for anonymous mappings

This commit is contained in:
Balazs Gerofi
2016-12-31 10:09:49 +09:00
parent 40d75baca2
commit 4437ecc69a
2 changed files with 11 additions and 2 deletions

View File

@ -497,7 +497,10 @@ static int fileobj_get_page(struct memobj *memobj, off_t off,
if (!page) {
npages = 1 << p2align;
virt = ihk_mc_alloc_pages(npages, IHK_MC_AP_NOWAIT);
virt = ihk_mc_alloc_pages(npages, IHK_MC_AP_NOWAIT |
(to_memobj(obj)->flags & MF_ZEROFILL) ? IHK_MC_AP_USER : 0);
if (!virt) {
error = -ENOMEM;
kprintf("fileobj_get_page(%p,%lx,%x,%p):"