Previously, metadata was stored in the allocated pages themselves
during allocation. However the system can only have a limited
number of kmapped pages. A very large allocation might exceed
this limit.
Change-Id: Ibe972096e83924bf5e621d8282c4cd133ca75b0a
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
if (!page)
continue;
split_page(page, orders[i]);
- info = kmap(page);
+ info = kmalloc(sizeof(struct page_info *), GFP_KERNEL);
info->page = page;
info->order = orders[i];
return info;
}
list_del(&info->list);
memset(info, 0, sizeof(struct page_info));
- kunmap(page);
+ kfree(info);
}
dma_sync_sg_for_device(NULL, table->sgl, table->nents,
list_for_each_entry(info, &pages, list) {
for (i = 0; i < (1 << info->order); i++)
__free_page(info->page + i);
- kunmap(info->page);
+ kfree(info);
}
return -ENOMEM;
}