lkml.org 
[lkml]   [2024]   [Feb]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 10/10] iommu: account IOMMU allocated memory
On Tue, Feb 13, 2024 at 10:44:53AM -0500, Pasha Tatashin wrote:
> > > SecPageTables
> > > - Memory consumed by secondary page tables, this currently
> > > - currently includes KVM mmu allocations on x86 and arm64.
> > > + Memory consumed by secondary page tables, this currently includes
> > > + KVM mmu and IOMMU allocations on x86 and arm64.
>
> Hi Will,
>
> > While I can see the value in this for IOMMU mappings managed by VFIO,
> > doesn't this end up conflating that with the normal case of DMA domains?
> > For systems that e.g. rely on an IOMMU for functional host DMA, it seems
> > wrong to subject that to accounting constraints.
>
> The accounting constraints are only applicable when GFP_KERNEL_ACCOUNT
> is passed to the iommu mapping functions. We do that from the vfio,
> iommufd, and vhost. Without this flag, the memory useage is reported
> in /proc/meminfo as part of SecPageTables field, but not constrained
> in cgroup.

Thanks, Pasha, that explanation makes sense. I still find it bizarre to
include IOMMU allocations from the DMA API in SecPageTables though, and
I worry that it will confuse people who are using that metric as a way
to get a feeling for how much memory is being used by KVM's secondary
page-tables. As an extreme example, having a non-zero SecPageTables count
without KVM even compiled in is pretty bizarre.

Will

\
 
 \ /
  Last update: 2024-05-27 15:07    [W:0.098 / U:0.208 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site