Message ID | 20240222173942.1481394-1-pasha.tatashin@soleen.com |
---|---|
Headers | show |
Series | IOMMU memory observability | expand |
On Thu, 22 Feb 2024, Pasha Tatashin wrote: > Pasha Tatashin (11): > iommu/vt-d: add wrapper functions for page allocations > iommu/dma: use iommu_put_pages_list() to releae freelist > iommu/amd: use page allocation function provided by iommu-pages.h > iommu/io-pgtable-arm: use page allocation function provided by > iommu-pages.h > iommu/io-pgtable-dart: use page allocation function provided by > iommu-pages.h > iommu/exynos: use page allocation function provided by iommu-pages.h > iommu/rockchip: use page allocation function provided by iommu-pages.h > iommu/sun50i: use page allocation function provided by iommu-pages.h > iommu/tegra-smmu: use page allocation function provided by > iommu-pages.h > iommu: observability of the IOMMU allocations > iommu: account IOMMU allocated memory > > Documentation/admin-guide/cgroup-v2.rst | 2 +- > Documentation/filesystems/proc.rst | 4 +- > drivers/iommu/amd/amd_iommu.h | 8 - > drivers/iommu/amd/init.c | 91 ++++++------ > drivers/iommu/amd/io_pgtable.c | 13 +- > drivers/iommu/amd/io_pgtable_v2.c | 20 +-- > drivers/iommu/amd/iommu.c | 13 +- > drivers/iommu/dma-iommu.c | 7 +- > drivers/iommu/exynos-iommu.c | 14 +- > drivers/iommu/intel/dmar.c | 16 +- > drivers/iommu/intel/iommu.c | 47 ++---- > drivers/iommu/intel/iommu.h | 2 - > drivers/iommu/intel/irq_remapping.c | 16 +- > drivers/iommu/intel/pasid.c | 18 +-- > drivers/iommu/intel/svm.c | 11 +- > drivers/iommu/io-pgtable-arm.c | 15 +- > drivers/iommu/io-pgtable-dart.c | 37 ++--- > drivers/iommu/iommu-pages.h | 186 ++++++++++++++++++++++++ > drivers/iommu/rockchip-iommu.c | 14 +- > drivers/iommu/sun50i-iommu.c | 7 +- > drivers/iommu/tegra-smmu.c | 18 ++- > include/linux/mmzone.h | 5 +- > mm/vmstat.c | 3 + > 23 files changed, 361 insertions(+), 206 deletions(-) > create mode 100644 drivers/iommu/iommu-pages.h > Joerg, is this series anticipated to be queued up in the core branch of git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git so it gets into linux-next? This observability seems particularly useful so that we can monitor and alert on any unexpected increases (unbounded memory growth from this subsystem has in the past caused us issues before the memory is otherwise not observable by host software). Or are we still waiting on code reviews from some folks that we should ping? Thanks!
Hi David, On Fri, Mar 15, 2024 at 02:33:53PM -0700, David Rientjes wrote: > Joerg, is this series anticipated to be queued up in the core branch of > git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git so it gets into > linux-next? > > This observability seems particularly useful so that we can monitor and > alert on any unexpected increases (unbounded memory growth from this > subsystem has in the past caused us issues before the memory is otherwise > not observable by host software). > > Or are we still waiting on code reviews from some folks that we should > ping? A few more reviews would certainly help, but I will also do a review on my own. If things are looking good I can merge it into the iommu tree when 6.9-rc3 is released (which is the usual time I start merging new stuff). Regards, Joerg
> > Description > > ---------------------------------------------------------------------- > > IOMMU subsystem may contain state that is in gigabytes. Majority of that > > state is iommu page tables. Yet, there is currently, no way to observe > > how much memory is actually used by the iommu subsystem. > > > > This patch series solves this problem by adding both observability to > > all pages that are allocated by IOMMU, and also accountability, so > > admins can limit the amount if via cgroups. > > > > The system-wide observability is using /proc/meminfo: > > SecPageTables: 438176 kB > > > > Contains IOMMU and KVM memory. > > Can you please clarify what does KVM memory refers to here ? > Does it mean the VFIO map / virtio-iommu invoked ones for a guest VM? This means that nested page tables that are managed by KVM, and device page tables that are managed by IOMMU are all accounted in SecPageTables (secondary page tables). The decision to account them both in one field of meminfo was made at LPC'23. Pasha
Pasha, On Thu, Feb 22, 2024 at 05:39:26PM +0000, Pasha Tatashin wrote: > Pasha Tatashin (11): > iommu/vt-d: add wrapper functions for page allocations > iommu/dma: use iommu_put_pages_list() to releae freelist > iommu/amd: use page allocation function provided by iommu-pages.h > iommu/io-pgtable-arm: use page allocation function provided by > iommu-pages.h > iommu/io-pgtable-dart: use page allocation function provided by > iommu-pages.h > iommu/exynos: use page allocation function provided by iommu-pages.h > iommu/rockchip: use page allocation function provided by iommu-pages.h > iommu/sun50i: use page allocation function provided by iommu-pages.h > iommu/tegra-smmu: use page allocation function provided by > iommu-pages.h > iommu: observability of the IOMMU allocations > iommu: account IOMMU allocated memory Some problems with this: 1. I get DKIM failures when downloading this patch-set with b4, can you please send them via a mailserver with working DKIM? 2. They don't apply to v6.9-rc3. Please rebase to that version and are-send. Thanks, Joerg
> Some problems with this: > > 1. I get DKIM failures when downloading this patch-set with b4, can > you please send them via a mailserver with working DKIM? I was in the process of migrating from google domains to a different registrar, but I think now the issue is resolved. I will verify it. > 2. They don't apply to v6.9-rc3. Please rebase to that version and > are-send. I will. Thanks, Pasha