[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240213131210.GA28926@willie-the-truck>
Date: Tue, 13 Feb 2024 13:12:11 +0000
From: Will Deacon <will@...nel.org>
To: Pasha Tatashin <pasha.tatashin@...een.com>
Cc: akpm@...ux-foundation.org, alim.akhtar@...sung.com,
alyssa@...enzweig.io, asahi@...ts.linux.dev,
baolu.lu@...ux.intel.com, bhelgaas@...gle.com,
cgroups@...r.kernel.org, corbet@....net, david@...hat.com,
dwmw2@...radead.org, hannes@...xchg.org, heiko@...ech.de,
iommu@...ts.linux.dev, jernej.skrabec@...il.com,
jonathanh@...dia.com, joro@...tes.org,
krzysztof.kozlowski@...aro.org, linux-doc@...r.kernel.org,
linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-mm@...ck.org, linux-rockchip@...ts.infradead.org,
linux-samsung-soc@...r.kernel.org, linux-sunxi@...ts.linux.dev,
linux-tegra@...r.kernel.org, lizefan.x@...edance.com,
marcan@...can.st, mhiramat@...nel.org, m.szyprowski@...sung.com,
paulmck@...nel.org, rdunlap@...radead.org, robin.murphy@....com,
samuel@...lland.org, suravee.suthikulpanit@....com,
sven@...npeter.dev, thierry.reding@...il.com, tj@...nel.org,
tomas.mudrunka@...il.com, vdumpa@...dia.com, wens@...e.org,
yu-cheng.yu@...el.com, rientjes@...gle.com
Subject: Re: [PATCH v3 10/10] iommu: account IOMMU allocated memory
Hi Pasha,
On Tue, Dec 26, 2023 at 08:02:05PM +0000, Pasha Tatashin wrote:
> In order to be able to limit the amount of memory that is allocated
> by IOMMU subsystem, the memory must be accounted.
>
> Account IOMMU as part of the secondary pagetables as it was discussed
> at LPC.
>
> The value of SecPageTables now contains mmeory allocation by IOMMU
> and KVM.
>
> Signed-off-by: Pasha Tatashin <pasha.tatashin@...een.com>
> ---
> Documentation/admin-guide/cgroup-v2.rst | 2 +-
> Documentation/filesystems/proc.rst | 4 ++--
> drivers/iommu/iommu-pages.h | 2 ++
> include/linux/mmzone.h | 2 +-
> 4 files changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/Documentation/admin-guide/cgroup-v2.rst b/Documentation/admin-guide/cgroup-v2.rst
> index 3f85254f3cef..e004e05a7cde 100644
> --- a/Documentation/admin-guide/cgroup-v2.rst
> +++ b/Documentation/admin-guide/cgroup-v2.rst
> @@ -1418,7 +1418,7 @@ PAGE_SIZE multiple when read back.
> sec_pagetables
> Amount of memory allocated for secondary page tables,
> this currently includes KVM mmu allocations on x86
> - and arm64.
> + and arm64 and IOMMU page tables.
>
> percpu (npn)
> Amount of memory used for storing per-cpu kernel
> diff --git a/Documentation/filesystems/proc.rst b/Documentation/filesystems/proc.rst
> index 49ef12df631b..86f137a9b66b 100644
> --- a/Documentation/filesystems/proc.rst
> +++ b/Documentation/filesystems/proc.rst
> @@ -1110,8 +1110,8 @@ KernelStack
> PageTables
> Memory consumed by userspace page tables
> 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.
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.
Will
Powered by blists - more mailing lists