mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-09 05:39:54 -04:00
Merge "iommu/io-pgtable: Add support for io-pgtable accounting"
This commit is contained in:
commit
0cdc4fc71c
3 changed files with 13 additions and 3 deletions
|
|
@ -2,6 +2,7 @@ CONFIG_LOCALVERSION="-qgki-consolidate"
|
|||
CONFIG_IOMMU_TLBSYNC_DEBUG=y
|
||||
CONFIG_IOMMU_DEBUG=y
|
||||
CONFIG_IOMMU_TESTS=y
|
||||
CONFIG_IO_PGTABLE_PAGE_ACCOUNTING=y
|
||||
CONFIG_CMA_DEBUGFS=y
|
||||
CONFIG_CMA_DEBUG=y
|
||||
CONFIG_DEBUG_PAGEALLOC=y
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
CONFIG_LOCALVERSION="-qgki-debug"
|
||||
CONFIG_SLUB_DEBUG_PANIC_ON=y
|
||||
CONFIG_IO_PGTABLE_PAGE_ACCOUNTING=y
|
||||
CONFIG_SLUB_DEBUG_ON=y
|
||||
CONFIG_DEBUG_KMEMLEAK=y
|
||||
CONFIG_DEBUG_KMEMLEAK_EARLY_LOG_SIZE=4000
|
||||
|
|
|
|||
|
|
@ -149,19 +149,27 @@ void *io_pgtable_alloc_pages(struct io_pgtable_cfg *cfg, void *cookie,
|
|||
{
|
||||
struct device *dev;
|
||||
struct page *p;
|
||||
void *page_addr;
|
||||
|
||||
if (!cfg)
|
||||
return NULL;
|
||||
|
||||
if (cfg->iommu_pgtable_ops && cfg->iommu_pgtable_ops->alloc_pgtable)
|
||||
return cfg->iommu_pgtable_ops->alloc_pgtable(cookie, order,
|
||||
if (cfg->iommu_pgtable_ops && cfg->iommu_pgtable_ops->alloc_pgtable) {
|
||||
page_addr = cfg->iommu_pgtable_ops->alloc_pgtable(cookie, order,
|
||||
gfp_mask);
|
||||
if (likely(page_addr))
|
||||
mod_pages_allocated(1 << order);
|
||||
|
||||
return page_addr;
|
||||
}
|
||||
|
||||
dev = cfg->iommu_dev;
|
||||
p = alloc_pages_node(dev ? dev_to_node(dev) : NUMA_NO_NODE,
|
||||
gfp_mask, order);
|
||||
if (!p)
|
||||
return NULL;
|
||||
|
||||
mod_pages_allocated(1 << order);
|
||||
return page_address(p);
|
||||
}
|
||||
|
||||
|
|
@ -175,4 +183,6 @@ void io_pgtable_free_pages(struct io_pgtable_cfg *cfg, void *cookie, void *virt,
|
|||
cfg->iommu_pgtable_ops->free_pgtable(cookie, virt, order);
|
||||
else
|
||||
free_pages((unsigned long)virt, order);
|
||||
|
||||
mod_pages_allocated(-(1 << order));
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue