On Wed, Nov 25, 2026 at 09:37:10PM +0000, Harry Yoo (Meta) wrote:
> vfio, iommufd and vhost-vdpa call iommu_map() with GFP_KERNEL_ACCOUNT > and the gfp is passed down to the drivers' page table allocations. > Specify SLAB_MAY_ACCOUNT when the object may be charged to a memcg. > __GFP_ACCOUNT without SLAB_MAY_ACCOUNT will not be allowed. > > Paths: > VFIO_IOMMU_MAP_DMA -> iommu_map(GFP_KERNEL_ACCOUNT) > -> s390_iommu_map_pages() -> dma_walk_cpu_trans() > -> kmem_cache_alloc(dma_{region,page}_table_cache) > iommu_map(GFP_KERNEL_ACCOUNT) -> arm_v7s_map_pages() > -> __arm_v7s_alloc_table() -> kmem_cache_zalloc(data->l2_tables) > iommu_map(GFP_KERNEL_ACCOUNT) -> sun50i_iommu_map() > -> sun50i_dte_get_page_table() -> kmem_cache_zalloc(iommu->pt_pool) > > Cc: Will Deacon <wi…@kernel.org> > Cc: Robin Murphy <robi…@arm.com> > Cc: "Joerg Roedel (AMD)" <jo…@8bytes.org> > Cc: Niklas Schnelle <schn…@linux.ibm.com> > Cc: Matthew Rosato <mjro…@linux.ibm.com> > Cc: Gerald Schaefer <gera…@linux.ibm.com> > Cc: Chen-Yu Tsai <we…@kernel.org> > Cc: Jernej Skrabec <jern…@gmail.com> > Cc: Samuel Holland <samu…@sholland.org> > Cc: linu…@lists.infradead.org > Cc: iom…@lists.linux.dev > Cc: linu…@vger.kernel.org > Cc: linu…@lists.linux.dev > Signed-off-by: Harry Yoo (Meta) <har…@kernel.org> > --- > drivers/iommu/io-pgtable-arm-v7s.c | 2 +- > drivers/iommu/s390-iommu.c | 4 ++-- > drivers/iommu/sun50i-iommu.c | 3 ++- > 3 files changed, 5 insertions(+), 4 deletions(-)
Looks good to me. Reviewed-by: Hao Li <hao…@linux.dev>
-- Thanks, Hao