2023-11-30 20:15:41

by Pasha Tatashin

[permalink] [raw]
Subject: [PATCH v2 00/10] IOMMU memory observability

From: Pasha Tatashin <[email protected]>

----------------------------------------------------------------------
Changelog
----------------------------------------------------------------------
v2:
- Added Reviewed-by Janne Grunau
- Sync with 6.7.0-rc3, 3b47bc037bd44f142ac09848e8d3ecccc726be99
- Separated form the series patches:
vhost-vdpa: account iommu allocations
https://lore.kernel.org/all/[email protected]
vfio: account iommu allocations
https://lore.kernel.org/all/[email protected]
as suggested by Jason Gunthorpe
- Fixed SPARC build issue detected by kernel test robot
- Drop the following patches as they do account iommu page tables:
iommu/dma: use page allocation function provided by iommu-pages.h
iommu/fsl: use page allocation function provided by iommu-pages.h
iommu/iommufd: use page allocation function provided by iommu-pages.h
as suggested by Robin Murphy. These patches are not related to IOMMU
page tables. We might need to do a separate work to support DMA
observability.
- Remove support iommu/io-pgtable-arm-v7s as the 2nd level pages are
under a page size, thanks Robin Murphy for pointing this out.

----------------------------------------------------------------------
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.

Per-node observability:
/sys/devices/system/node/nodeN/meminfo
Node N SecPageTables: 422204 kB

Contains IOMMU and KVM memory memory in the given NUMA node.

Per-node IOMMU only observability:
/sys/devices/system/node/nodeN/vmstat
nr_iommu_pages 105555

Contains number of pages IOMMU allocated in the given node.

Accountability: using sec_pagetables cgroup-v2 memory.stat entry.

With the change, iova_stress[1] stops as limit is reached:

# ./iova_stress
iova space: 0T free memory: 497G
iova space: 1T free memory: 495G
iova space: 2T free memory: 493G
iova space: 3T free memory: 491G

stops as limit is reached.

This series encorporates suggestions that came from the discussion
at LPC [2].
----------------------------------------------------------------------
[1] https://github.com/soleen/iova_stress
[2] https://lpc.events/event/17/contributions/1466
----------------------------------------------------------------------
Previous versions
v1: https://lore.kernel.org/all/[email protected]
----------------------------------------------------------------------

Pasha Tatashin (10):
iommu/vt-d: add wrapper functions for page allocations
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/exynos-iommu.c | 14 +-
drivers/iommu/intel/dmar.c | 10 +-
drivers/iommu/intel/iommu.c | 47 ++---
drivers/iommu/intel/iommu.h | 2 -
drivers/iommu/intel/irq_remapping.c | 10 +-
drivers/iommu/intel/pasid.c | 12 +-
drivers/iommu/intel/svm.c | 7 +-
drivers/iommu/io-pgtable-arm.c | 7 +-
drivers/iommu/io-pgtable-dart.c | 37 ++--
drivers/iommu/iommu-pages.h | 231 ++++++++++++++++++++++++
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 +
22 files changed, 390 insertions(+), 185 deletions(-)
create mode 100644 drivers/iommu/iommu-pages.h

--
2.43.0.rc2.451.g8631bc7472-goog


2023-11-30 20:15:58

by Pasha Tatashin

[permalink] [raw]
Subject: [PATCH v2 03/10] iommu/io-pgtable-arm: use page allocation function provided by iommu-pages.h

Convert iommu/io-pgtable-arm.c to use the new page allocation functions
provided in iommu-pages.h.

Signed-off-by: Pasha Tatashin <[email protected]>
---
drivers/iommu/io-pgtable-arm.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/iommu/io-pgtable-arm.c b/drivers/iommu/io-pgtable-arm.c
index 72dcdd468cf3..21d315151ad6 100644
--- a/drivers/iommu/io-pgtable-arm.c
+++ b/drivers/iommu/io-pgtable-arm.c
@@ -21,6 +21,7 @@
#include <asm/barrier.h>

#include "io-pgtable-arm.h"
+#include "iommu-pages.h"

#define ARM_LPAE_MAX_ADDR_BITS 52
#define ARM_LPAE_S2_MAX_CONCAT_PAGES 16
@@ -197,7 +198,7 @@ static void *__arm_lpae_alloc_pages(size_t size, gfp_t gfp,
void *pages;

VM_BUG_ON((gfp & __GFP_HIGHMEM));
- p = alloc_pages_node(dev_to_node(dev), gfp | __GFP_ZERO, order);
+ p = __iommu_alloc_pages_node(dev_to_node(dev), gfp, order);
if (!p)
return NULL;

@@ -221,7 +222,7 @@ static void *__arm_lpae_alloc_pages(size_t size, gfp_t gfp,
dev_err(dev, "Cannot accommodate DMA translation for IOMMU page tables\n");
dma_unmap_single(dev, dma, size, DMA_TO_DEVICE);
out_free:
- __free_pages(p, order);
+ __iommu_free_pages(p, order);
return NULL;
}

@@ -231,7 +232,7 @@ static void __arm_lpae_free_pages(void *pages, size_t size,
if (!cfg->coherent_walk)
dma_unmap_single(cfg->iommu_dev, __arm_lpae_dma_addr(pages),
size, DMA_TO_DEVICE);
- free_pages((unsigned long)pages, get_order(size));
+ iommu_free_pages(pages, get_order(size));
}

static void __arm_lpae_sync_pte(arm_lpae_iopte *ptep, int num_entries,
--
2.43.0.rc2.451.g8631bc7472-goog

2023-11-30 20:16:15

by Pasha Tatashin

[permalink] [raw]
Subject: [PATCH v2 04/10] iommu/io-pgtable-dart: use page allocation function provided by iommu-pages.h

Convert iommu/io-pgtable-dart.c to use the new page allocation functions
provided in iommu-pages.h.

Signed-off-by: Pasha Tatashin <[email protected]>
Reviewed-by: Janne Grunau <[email protected]>
---
drivers/iommu/io-pgtable-dart.c | 37 +++++++++++++--------------------
1 file changed, 14 insertions(+), 23 deletions(-)

diff --git a/drivers/iommu/io-pgtable-dart.c b/drivers/iommu/io-pgtable-dart.c
index 74b1ef2b96be..ad28031e1e93 100644
--- a/drivers/iommu/io-pgtable-dart.c
+++ b/drivers/iommu/io-pgtable-dart.c
@@ -23,6 +23,7 @@
#include <linux/types.h>

#include <asm/barrier.h>
+#include "iommu-pages.h"

#define DART1_MAX_ADDR_BITS 36

@@ -106,18 +107,12 @@ static phys_addr_t iopte_to_paddr(dart_iopte pte,
return paddr;
}

-static void *__dart_alloc_pages(size_t size, gfp_t gfp,
- struct io_pgtable_cfg *cfg)
+static void *__dart_alloc_pages(size_t size, gfp_t gfp)
{
int order = get_order(size);
- struct page *p;

VM_BUG_ON((gfp & __GFP_HIGHMEM));
- p = alloc_pages(gfp | __GFP_ZERO, order);
- if (!p)
- return NULL;
-
- return page_address(p);
+ return iommu_alloc_pages(gfp, order);
}

static int dart_init_pte(struct dart_io_pgtable *data,
@@ -262,13 +257,13 @@ static int dart_map_pages(struct io_pgtable_ops *ops, unsigned long iova,

/* no L2 table present */
if (!pte) {
- cptep = __dart_alloc_pages(tblsz, gfp, cfg);
+ cptep = __dart_alloc_pages(tblsz, gfp);
if (!cptep)
return -ENOMEM;

pte = dart_install_table(cptep, ptep, 0, data);
if (pte)
- free_pages((unsigned long)cptep, get_order(tblsz));
+ iommu_free_pages(cptep, get_order(tblsz));

/* L2 table is present (now) */
pte = READ_ONCE(*ptep);
@@ -419,8 +414,7 @@ apple_dart_alloc_pgtable(struct io_pgtable_cfg *cfg, void *cookie)
cfg->apple_dart_cfg.n_ttbrs = 1 << data->tbl_bits;

for (i = 0; i < cfg->apple_dart_cfg.n_ttbrs; ++i) {
- data->pgd[i] = __dart_alloc_pages(DART_GRANULE(data), GFP_KERNEL,
- cfg);
+ data->pgd[i] = __dart_alloc_pages(DART_GRANULE(data), GFP_KERNEL);
if (!data->pgd[i])
goto out_free_data;
cfg->apple_dart_cfg.ttbr[i] = virt_to_phys(data->pgd[i]);
@@ -429,9 +423,10 @@ apple_dart_alloc_pgtable(struct io_pgtable_cfg *cfg, void *cookie)
return &data->iop;

out_free_data:
- while (--i >= 0)
- free_pages((unsigned long)data->pgd[i],
- get_order(DART_GRANULE(data)));
+ while (--i >= 0) {
+ iommu_free_pages(data->pgd[i],
+ get_order(DART_GRANULE(data)));
+ }
kfree(data);
return NULL;
}
@@ -439,6 +434,7 @@ apple_dart_alloc_pgtable(struct io_pgtable_cfg *cfg, void *cookie)
static void apple_dart_free_pgtable(struct io_pgtable *iop)
{
struct dart_io_pgtable *data = io_pgtable_to_data(iop);
+ int order = get_order(DART_GRANULE(data));
dart_iopte *ptep, *end;
int i;

@@ -449,15 +445,10 @@ static void apple_dart_free_pgtable(struct io_pgtable *iop)
while (ptep != end) {
dart_iopte pte = *ptep++;

- if (pte) {
- unsigned long page =
- (unsigned long)iopte_deref(pte, data);
-
- free_pages(page, get_order(DART_GRANULE(data)));
- }
+ if (pte)
+ iommu_free_pages(iopte_deref(pte, data), order);
}
- free_pages((unsigned long)data->pgd[i],
- get_order(DART_GRANULE(data)));
+ iommu_free_pages(data->pgd[i], order);
}

kfree(data);
--
2.43.0.rc2.451.g8631bc7472-goog

2023-11-30 20:16:18

by Pasha Tatashin

[permalink] [raw]
Subject: [PATCH v2 08/10] iommu/tegra-smmu: use page allocation function provided by iommu-pages.h

Convert iommu/tegra-smmu.c to use the new page allocation functions
provided in iommu-pages.h.

Signed-off-by: Pasha Tatashin <[email protected]>
---
drivers/iommu/tegra-smmu.c | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/drivers/iommu/tegra-smmu.c b/drivers/iommu/tegra-smmu.c
index 310871728ab4..5e0730dc1b0e 100644
--- a/drivers/iommu/tegra-smmu.c
+++ b/drivers/iommu/tegra-smmu.c
@@ -19,6 +19,8 @@
#include <soc/tegra/ahb.h>
#include <soc/tegra/mc.h>

+#include "iommu-pages.h"
+
struct tegra_smmu_group {
struct list_head list;
struct tegra_smmu *smmu;
@@ -282,7 +284,7 @@ static struct iommu_domain *tegra_smmu_domain_alloc_paging(struct device *dev)

as->attr = SMMU_PD_READABLE | SMMU_PD_WRITABLE | SMMU_PD_NONSECURE;

- as->pd = alloc_page(GFP_KERNEL | __GFP_DMA | __GFP_ZERO);
+ as->pd = __iommu_alloc_page(GFP_KERNEL | __GFP_DMA);
if (!as->pd) {
kfree(as);
return NULL;
@@ -290,7 +292,7 @@ static struct iommu_domain *tegra_smmu_domain_alloc_paging(struct device *dev)

as->count = kcalloc(SMMU_NUM_PDE, sizeof(u32), GFP_KERNEL);
if (!as->count) {
- __free_page(as->pd);
+ __iommu_free_page(as->pd);
kfree(as);
return NULL;
}
@@ -298,7 +300,7 @@ static struct iommu_domain *tegra_smmu_domain_alloc_paging(struct device *dev)
as->pts = kcalloc(SMMU_NUM_PDE, sizeof(*as->pts), GFP_KERNEL);
if (!as->pts) {
kfree(as->count);
- __free_page(as->pd);
+ __iommu_free_page(as->pd);
kfree(as);
return NULL;
}
@@ -599,14 +601,14 @@ static u32 *as_get_pte(struct tegra_smmu_as *as, dma_addr_t iova,
dma = dma_map_page(smmu->dev, page, 0, SMMU_SIZE_PT,
DMA_TO_DEVICE);
if (dma_mapping_error(smmu->dev, dma)) {
- __free_page(page);
+ __iommu_free_page(page);
return NULL;
}

if (!smmu_dma_addr_valid(smmu, dma)) {
dma_unmap_page(smmu->dev, dma, SMMU_SIZE_PT,
DMA_TO_DEVICE);
- __free_page(page);
+ __iommu_free_page(page);
return NULL;
}

@@ -649,7 +651,7 @@ static void tegra_smmu_pte_put_use(struct tegra_smmu_as *as, unsigned long iova)
tegra_smmu_set_pde(as, iova, 0);

dma_unmap_page(smmu->dev, pte_dma, SMMU_SIZE_PT, DMA_TO_DEVICE);
- __free_page(page);
+ __iommu_free_page(page);
as->pts[pde] = NULL;
}
}
@@ -688,7 +690,7 @@ static struct page *as_get_pde_page(struct tegra_smmu_as *as,
if (gfpflags_allow_blocking(gfp))
spin_unlock_irqrestore(&as->lock, *flags);

- page = alloc_page(gfp | __GFP_DMA | __GFP_ZERO);
+ page = __iommu_alloc_page(gfp | __GFP_DMA);

if (gfpflags_allow_blocking(gfp))
spin_lock_irqsave(&as->lock, *flags);
@@ -700,7 +702,7 @@ static struct page *as_get_pde_page(struct tegra_smmu_as *as,
*/
if (as->pts[pde]) {
if (page)
- __free_page(page);
+ __iommu_free_page(page);

page = as->pts[pde];
}
--
2.43.0.rc2.451.g8631bc7472-goog

2023-11-30 20:16:18

by Pasha Tatashin

[permalink] [raw]
Subject: [PATCH v2 10/10] iommu: account IOMMU allocated memory

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 <[email protected]>
---
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.
NFS_Unstable
Always zero. Previous counted pages which had been written to
the server, but has not been committed to stable storage.
diff --git a/drivers/iommu/iommu-pages.h b/drivers/iommu/iommu-pages.h
index 69895a355c0c..cdd257585284 100644
--- a/drivers/iommu/iommu-pages.h
+++ b/drivers/iommu/iommu-pages.h
@@ -27,6 +27,7 @@ static inline void __iommu_alloc_account(struct page *pages, int order)
const long pgcnt = 1l << order;

mod_node_page_state(page_pgdat(pages), NR_IOMMU_PAGES, pgcnt);
+ mod_lruvec_page_state(pages, NR_SECONDARY_PAGETABLE, pgcnt);
}

/**
@@ -39,6 +40,7 @@ static inline void __iommu_free_account(struct page *pages, int order)
const long pgcnt = 1l << order;

mod_node_page_state(page_pgdat(pages), NR_IOMMU_PAGES, -pgcnt);
+ mod_lruvec_page_state(pages, NR_SECONDARY_PAGETABLE, -pgcnt);
}

/**
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index 1a4d0bba3e8b..aaabb385663c 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -199,7 +199,7 @@ enum node_stat_item {
NR_KERNEL_SCS_KB, /* measured in KiB */
#endif
NR_PAGETABLE, /* used for pagetables */
- NR_SECONDARY_PAGETABLE, /* secondary pagetables, e.g. KVM pagetables */
+ NR_SECONDARY_PAGETABLE, /* secondary pagetables, KVM & IOMMU */
#ifdef CONFIG_IOMMU_SUPPORT
NR_IOMMU_PAGES, /* # of pages allocated by IOMMU */
#endif
--
2.43.0.rc2.451.g8631bc7472-goog

2023-11-30 20:16:18

by Pasha Tatashin

[permalink] [raw]
Subject: [PATCH v2 05/10] iommu/exynos: use page allocation function provided by iommu-pages.h

Convert iommu/exynos-iommu.c to use the new page allocation functions
provided in iommu-pages.h.

Signed-off-by: Pasha Tatashin <[email protected]>
---
drivers/iommu/exynos-iommu.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c
index 2c6e9094f1e9..3eab0ae65a4f 100644
--- a/drivers/iommu/exynos-iommu.c
+++ b/drivers/iommu/exynos-iommu.c
@@ -22,6 +22,8 @@
#include <linux/pm_runtime.h>
#include <linux/slab.h>

+#include "iommu-pages.h"
+
typedef u32 sysmmu_iova_t;
typedef u32 sysmmu_pte_t;
static struct iommu_domain exynos_identity_domain;
@@ -900,11 +902,11 @@ static struct iommu_domain *exynos_iommu_domain_alloc_paging(struct device *dev)
if (!domain)
return NULL;

- domain->pgtable = (sysmmu_pte_t *)__get_free_pages(GFP_KERNEL, 2);
+ domain->pgtable = iommu_alloc_pages(GFP_KERNEL, 2);
if (!domain->pgtable)
goto err_pgtable;

- domain->lv2entcnt = (short *)__get_free_pages(GFP_KERNEL | __GFP_ZERO, 1);
+ domain->lv2entcnt = iommu_alloc_pages(GFP_KERNEL, 1);
if (!domain->lv2entcnt)
goto err_counter;

@@ -930,9 +932,9 @@ static struct iommu_domain *exynos_iommu_domain_alloc_paging(struct device *dev)
return &domain->domain;

err_lv2ent:
- free_pages((unsigned long)domain->lv2entcnt, 1);
+ iommu_free_pages(domain->lv2entcnt, 1);
err_counter:
- free_pages((unsigned long)domain->pgtable, 2);
+ iommu_free_pages(domain->pgtable, 2);
err_pgtable:
kfree(domain);
return NULL;
@@ -973,8 +975,8 @@ static void exynos_iommu_domain_free(struct iommu_domain *iommu_domain)
phys_to_virt(base));
}

- free_pages((unsigned long)domain->pgtable, 2);
- free_pages((unsigned long)domain->lv2entcnt, 1);
+ iommu_free_pages(domain->pgtable, 2);
+ iommu_free_pages(domain->lv2entcnt, 1);
kfree(domain);
}

--
2.43.0.rc2.451.g8631bc7472-goog

2023-11-30 20:16:19

by Pasha Tatashin

[permalink] [raw]
Subject: [PATCH v2 09/10] iommu: observability of the IOMMU allocations

Add NR_IOMMU_PAGES into node_stat_item that counts number of pages
that are allocated by the IOMMU subsystem.

The allocations can be view per-node via:
/sys/devices/system/node/nodeN/vmstat.

For example:

$ grep iommu /sys/devices/system/node/node*/vmstat
/sys/devices/system/node/node0/vmstat:nr_iommu_pages 106025
/sys/devices/system/node/node1/vmstat:nr_iommu_pages 3464

The value is in page-count, therefore, in the above example
the iommu allocations amount to ~428M.

Signed-off-by: Pasha Tatashin <[email protected]>
---
drivers/iommu/iommu-pages.h | 30 ++++++++++++++++++++++++++++++
include/linux/mmzone.h | 3 +++
mm/vmstat.c | 3 +++
3 files changed, 36 insertions(+)

diff --git a/drivers/iommu/iommu-pages.h b/drivers/iommu/iommu-pages.h
index 2332f807d514..69895a355c0c 100644
--- a/drivers/iommu/iommu-pages.h
+++ b/drivers/iommu/iommu-pages.h
@@ -17,6 +17,30 @@
* state can be rather large, i.e. multiple gigabytes in size.
*/

+/**
+ * __iommu_alloc_account - account for newly allocated page.
+ * @pages: head struct page of the page.
+ * @order: order of the page
+ */
+static inline void __iommu_alloc_account(struct page *pages, int order)
+{
+ const long pgcnt = 1l << order;
+
+ mod_node_page_state(page_pgdat(pages), NR_IOMMU_PAGES, pgcnt);
+}
+
+/**
+ * __iommu_free_account - account a page that is about to be freed.
+ * @pages: head struct page of the page.
+ * @order: order of the page
+ */
+static inline void __iommu_free_account(struct page *pages, int order)
+{
+ const long pgcnt = 1l << order;
+
+ mod_node_page_state(page_pgdat(pages), NR_IOMMU_PAGES, -pgcnt);
+}
+
/**
* __iommu_alloc_pages_node - allocate a zeroed page of a given order from
* specific NUMA node.
@@ -35,6 +59,8 @@ static inline struct page *__iommu_alloc_pages_node(int nid, gfp_t gfp,
if (!pages)
return NULL;

+ __iommu_alloc_account(pages, order);
+
return pages;
}

@@ -53,6 +79,8 @@ static inline struct page *__iommu_alloc_pages(gfp_t gfp, int order)
if (!pages)
return NULL;

+ __iommu_alloc_account(pages, order);
+
return pages;
}

@@ -89,6 +117,7 @@ static inline void __iommu_free_pages(struct page *pages, int order)
if (!pages)
return;

+ __iommu_free_account(pages, order);
__free_pages(pages, order);
}

@@ -192,6 +221,7 @@ static inline void iommu_free_pages_list(struct list_head *pages)
struct page *p = list_entry(pages->prev, struct page, lru);

list_del(&p->lru);
+ __iommu_free_account(p, 0);
put_page(p);
}
}
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index 3c25226beeed..1a4d0bba3e8b 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -200,6 +200,9 @@ enum node_stat_item {
#endif
NR_PAGETABLE, /* used for pagetables */
NR_SECONDARY_PAGETABLE, /* secondary pagetables, e.g. KVM pagetables */
+#ifdef CONFIG_IOMMU_SUPPORT
+ NR_IOMMU_PAGES, /* # of pages allocated by IOMMU */
+#endif
#ifdef CONFIG_SWAP
NR_SWAPCACHE,
#endif
diff --git a/mm/vmstat.c b/mm/vmstat.c
index 359460deb377..801b58890b6c 100644
--- a/mm/vmstat.c
+++ b/mm/vmstat.c
@@ -1242,6 +1242,9 @@ const char * const vmstat_text[] = {
#endif
"nr_page_table_pages",
"nr_sec_page_table_pages",
+#ifdef CONFIG_IOMMU_SUPPORT
+ "nr_iommu_pages",
+#endif
#ifdef CONFIG_SWAP
"nr_swapcached",
#endif
--
2.43.0.rc2.451.g8631bc7472-goog

2023-11-30 20:16:29

by Pasha Tatashin

[permalink] [raw]
Subject: [PATCH v2 06/10] iommu/rockchip: use page allocation function provided by iommu-pages.h

Convert iommu/rockchip-iommu.c to use the new page allocation functions
provided in iommu-pages.h.

Signed-off-by: Pasha Tatashin <[email protected]>
---
drivers/iommu/rockchip-iommu.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/iommu/rockchip-iommu.c b/drivers/iommu/rockchip-iommu.c
index 2685861c0a12..e04f22d481d0 100644
--- a/drivers/iommu/rockchip-iommu.c
+++ b/drivers/iommu/rockchip-iommu.c
@@ -26,6 +26,8 @@
#include <linux/slab.h>
#include <linux/spinlock.h>

+#include "iommu-pages.h"
+
/** MMU register offsets */
#define RK_MMU_DTE_ADDR 0x00 /* Directory table address */
#define RK_MMU_STATUS 0x04
@@ -727,14 +729,14 @@ static u32 *rk_dte_get_page_table(struct rk_iommu_domain *rk_domain,
if (rk_dte_is_pt_valid(dte))
goto done;

- page_table = (u32 *)get_zeroed_page(GFP_ATOMIC | rk_ops->gfp_flags);
+ page_table = iommu_alloc_page(GFP_ATOMIC | rk_ops->gfp_flags);
if (!page_table)
return ERR_PTR(-ENOMEM);

pt_dma = dma_map_single(dma_dev, page_table, SPAGE_SIZE, DMA_TO_DEVICE);
if (dma_mapping_error(dma_dev, pt_dma)) {
dev_err(dma_dev, "DMA mapping error while allocating page table\n");
- free_page((unsigned long)page_table);
+ iommu_free_page(page_table);
return ERR_PTR(-ENOMEM);
}

@@ -1061,7 +1063,7 @@ static struct iommu_domain *rk_iommu_domain_alloc_paging(struct device *dev)
* Each level1 (dt) and level2 (pt) table has 1024 4-byte entries.
* Allocate one 4 KiB page for each table.
*/
- rk_domain->dt = (u32 *)get_zeroed_page(GFP_KERNEL | rk_ops->gfp_flags);
+ rk_domain->dt = iommu_alloc_page(GFP_KERNEL | rk_ops->gfp_flags);
if (!rk_domain->dt)
goto err_free_domain;

@@ -1083,7 +1085,7 @@ static struct iommu_domain *rk_iommu_domain_alloc_paging(struct device *dev)
return &rk_domain->domain;

err_free_dt:
- free_page((unsigned long)rk_domain->dt);
+ iommu_free_page(rk_domain->dt);
err_free_domain:
kfree(rk_domain);

@@ -1104,13 +1106,13 @@ static void rk_iommu_domain_free(struct iommu_domain *domain)
u32 *page_table = phys_to_virt(pt_phys);
dma_unmap_single(dma_dev, pt_phys,
SPAGE_SIZE, DMA_TO_DEVICE);
- free_page((unsigned long)page_table);
+ iommu_free_page(page_table);
}
}

dma_unmap_single(dma_dev, rk_domain->dt_dma,
SPAGE_SIZE, DMA_TO_DEVICE);
- free_page((unsigned long)rk_domain->dt);
+ iommu_free_page(rk_domain->dt);

kfree(rk_domain);
}
--
2.43.0.rc2.451.g8631bc7472-goog

2023-11-30 20:16:36

by Pasha Tatashin

[permalink] [raw]
Subject: [PATCH v2 07/10] iommu/sun50i: use page allocation function provided by iommu-pages.h

Convert iommu/sun50i-iommu.c to use the new page allocation functions
provided in iommu-pages.h.

Signed-off-by: Pasha Tatashin <[email protected]>
---
drivers/iommu/sun50i-iommu.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/iommu/sun50i-iommu.c b/drivers/iommu/sun50i-iommu.c
index 41484a5a399b..172ddb717eb5 100644
--- a/drivers/iommu/sun50i-iommu.c
+++ b/drivers/iommu/sun50i-iommu.c
@@ -26,6 +26,8 @@
#include <linux/spinlock.h>
#include <linux/types.h>

+#include "iommu-pages.h"
+
#define IOMMU_RESET_REG 0x010
#define IOMMU_RESET_RELEASE_ALL 0xffffffff
#define IOMMU_ENABLE_REG 0x020
@@ -679,8 +681,7 @@ sun50i_iommu_domain_alloc_paging(struct device *dev)
if (!sun50i_domain)
return NULL;

- sun50i_domain->dt = (u32 *)__get_free_pages(GFP_KERNEL | __GFP_ZERO,
- get_order(DT_SIZE));
+ sun50i_domain->dt = iommu_alloc_pages(GFP_KERNEL, get_order(DT_SIZE));
if (!sun50i_domain->dt)
goto err_free_domain;

@@ -702,7 +703,7 @@ static void sun50i_iommu_domain_free(struct iommu_domain *domain)
{
struct sun50i_iommu_domain *sun50i_domain = to_sun50i_domain(domain);

- free_pages((unsigned long)sun50i_domain->dt, get_order(DT_SIZE));
+ iommu_free_pages(sun50i_domain->dt, get_order(DT_SIZE));
sun50i_domain->dt = NULL;

kfree(sun50i_domain);
--
2.43.0.rc2.451.g8631bc7472-goog

2023-12-14 18:01:06

by David Rientjes

[permalink] [raw]
Subject: Re: [PATCH v2 09/10] iommu: observability of the IOMMU allocations

On Thu, 30 Nov 2023, Pasha Tatashin wrote:

> Add NR_IOMMU_PAGES into node_stat_item that counts number of pages
> that are allocated by the IOMMU subsystem.
>
> The allocations can be view per-node via:
> /sys/devices/system/node/nodeN/vmstat.
>
> For example:
>
> $ grep iommu /sys/devices/system/node/node*/vmstat
> /sys/devices/system/node/node0/vmstat:nr_iommu_pages 106025
> /sys/devices/system/node/node1/vmstat:nr_iommu_pages 3464
>
> The value is in page-count, therefore, in the above example
> the iommu allocations amount to ~428M.
>
> Signed-off-by: Pasha Tatashin <[email protected]>

Acked-by: David Rientjes <[email protected]>

2023-12-14 18:02:34

by David Rientjes

[permalink] [raw]
Subject: Re: [PATCH v2 10/10] iommu: account IOMMU allocated memory

On Thu, 30 Nov 2023, 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 <[email protected]>
> ---
> 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.

Hmm, if existing users are parsing this field and alerting when it exceeds
an expected value (a cloud provider, let's say), is it safe to add in a
whole new set of page tables?

I understand the documentation allows for it, but I think potential impact
on userspace would be more interesting.

>
> 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.
> NFS_Unstable
> Always zero. Previous counted pages which had been written to
> the server, but has not been committed to stable storage.
> diff --git a/drivers/iommu/iommu-pages.h b/drivers/iommu/iommu-pages.h
> index 69895a355c0c..cdd257585284 100644
> --- a/drivers/iommu/iommu-pages.h
> +++ b/drivers/iommu/iommu-pages.h
> @@ -27,6 +27,7 @@ static inline void __iommu_alloc_account(struct page *pages, int order)
> const long pgcnt = 1l << order;
>
> mod_node_page_state(page_pgdat(pages), NR_IOMMU_PAGES, pgcnt);
> + mod_lruvec_page_state(pages, NR_SECONDARY_PAGETABLE, pgcnt);
> }
>
> /**
> @@ -39,6 +40,7 @@ static inline void __iommu_free_account(struct page *pages, int order)
> const long pgcnt = 1l << order;
>
> mod_node_page_state(page_pgdat(pages), NR_IOMMU_PAGES, -pgcnt);
> + mod_lruvec_page_state(pages, NR_SECONDARY_PAGETABLE, -pgcnt);
> }
>
> /**
> diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
> index 1a4d0bba3e8b..aaabb385663c 100644
> --- a/include/linux/mmzone.h
> +++ b/include/linux/mmzone.h
> @@ -199,7 +199,7 @@ enum node_stat_item {
> NR_KERNEL_SCS_KB, /* measured in KiB */
> #endif
> NR_PAGETABLE, /* used for pagetables */
> - NR_SECONDARY_PAGETABLE, /* secondary pagetables, e.g. KVM pagetables */
> + NR_SECONDARY_PAGETABLE, /* secondary pagetables, KVM & IOMMU */
> #ifdef CONFIG_IOMMU_SUPPORT
> NR_IOMMU_PAGES, /* # of pages allocated by IOMMU */
> #endif
> --
> 2.43.0.rc2.451.g8631bc7472-goog
>
>
>

2023-12-14 19:19:46

by Pasha Tatashin

[permalink] [raw]
Subject: Re: [PATCH v2 09/10] iommu: observability of the IOMMU allocations

On Thu, Dec 14, 2023 at 12:59 PM David Rientjes <[email protected]> wrote:
>
> On Thu, 30 Nov 2023, Pasha Tatashin wrote:
>
> > Add NR_IOMMU_PAGES into node_stat_item that counts number of pages
> > that are allocated by the IOMMU subsystem.
> >
> > The allocations can be view per-node via:
> > /sys/devices/system/node/nodeN/vmstat.
> >
> > For example:
> >
> > $ grep iommu /sys/devices/system/node/node*/vmstat
> > /sys/devices/system/node/node0/vmstat:nr_iommu_pages 106025
> > /sys/devices/system/node/node1/vmstat:nr_iommu_pages 3464
> >
> > The value is in page-count, therefore, in the above example
> > the iommu allocations amount to ~428M.
> >
> > Signed-off-by: Pasha Tatashin <[email protected]>
>
> Acked-by: David Rientjes <[email protected]>

Thank you,
Pasha

2023-12-15 21:12:22

by Pasha Tatashin

[permalink] [raw]
Subject: Re: [PATCH v2 10/10] iommu: account IOMMU allocated memory

> > 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.
>
> Hmm, if existing users are parsing this field and alerting when it exceeds
> an expected value (a cloud provider, let's say), is it safe to add in a
> whole new set of page tables?
>
> I understand the documentation allows for it, but I think potential impact
> on userspace would be more interesting.

Hi David,

This is something that was discussed at LPC'23. I also was proposing a
separate counter for iommu page tables, but it was noted that we
specifically have sec_pagetables called this way to include all non
regular CPU page tables, and we should therefore account for them
together.

Please also see this discussion from the previous version of this patch series:
https://lore.kernel.org/all/CAJD7tkb1FqTqwONrp2nphBDkEamQtPCOFm0208H3tp0Gq2OLMQ@mail.gmail.com/

Pasha

2023-12-24 21:34:44

by David Rientjes

[permalink] [raw]
Subject: Re: [PATCH v2 03/10] iommu/io-pgtable-arm: use page allocation function provided by iommu-pages.h

On Thu, 30 Nov 2023, Pasha Tatashin wrote:

> Convert iommu/io-pgtable-arm.c to use the new page allocation functions
> provided in iommu-pages.h.
>
> Signed-off-by: Pasha Tatashin <[email protected]>

Acked-by: David Rientjes <[email protected]>

2023-12-24 21:37:13

by David Rientjes

[permalink] [raw]
Subject: Re: [PATCH v2 04/10] iommu/io-pgtable-dart: use page allocation function provided by iommu-pages.h

On Thu, 30 Nov 2023, Pasha Tatashin wrote:

> Convert iommu/io-pgtable-dart.c to use the new page allocation functions
> provided in iommu-pages.h.
>

... and remove unnecessary struct io_pgtable_cfg formal to
__dart_alloc_pages() while there :)

> Signed-off-by: Pasha Tatashin <[email protected]>
> Reviewed-by: Janne Grunau <[email protected]>

Acked-by: David Rientjes <[email protected]>

2023-12-24 21:37:37

by David Rientjes

[permalink] [raw]
Subject: Re: [PATCH v2 05/10] iommu/exynos: use page allocation function provided by iommu-pages.h

On Thu, 30 Nov 2023, Pasha Tatashin wrote:

> Convert iommu/exynos-iommu.c to use the new page allocation functions
> provided in iommu-pages.h.
>
> Signed-off-by: Pasha Tatashin <[email protected]>

Acked-by: David Rientjes <[email protected]>

2023-12-24 21:39:41

by David Rientjes

[permalink] [raw]
Subject: Re: [PATCH v2 06/10] iommu/rockchip: use page allocation function provided by iommu-pages.h

On Thu, 30 Nov 2023, Pasha Tatashin wrote:

> Convert iommu/rockchip-iommu.c to use the new page allocation functions
> provided in iommu-pages.h.
>
> Signed-off-by: Pasha Tatashin <[email protected]>

Acked-by: David Rientjes <[email protected]>

2023-12-24 21:40:08

by David Rientjes

[permalink] [raw]
Subject: Re: [PATCH v2 07/10] iommu/sun50i: use page allocation function provided by iommu-pages.h

On Thu, 30 Nov 2023, Pasha Tatashin wrote:

> Convert iommu/sun50i-iommu.c to use the new page allocation functions
> provided in iommu-pages.h.
>
> Signed-off-by: Pasha Tatashin <[email protected]>

Acked-by: David Rientjes <[email protected]>

2023-12-24 21:40:42

by David Rientjes

[permalink] [raw]
Subject: Re: [PATCH v2 08/10] iommu/tegra-smmu: use page allocation function provided by iommu-pages.h

On Thu, 30 Nov 2023, Pasha Tatashin wrote:

> Convert iommu/tegra-smmu.c to use the new page allocation functions
> provided in iommu-pages.h.
>
> Signed-off-by: Pasha Tatashin <[email protected]>

Acked-by: David Rientjes <[email protected]>

2023-12-24 21:44:17

by David Rientjes

[permalink] [raw]
Subject: Re: [PATCH v2 10/10] iommu: account IOMMU allocated memory

On Fri, 15 Dec 2023, Pasha Tatashin wrote:

> > > 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.
> >
> > Hmm, if existing users are parsing this field and alerting when it exceeds
> > an expected value (a cloud provider, let's say), is it safe to add in a
> > whole new set of page tables?
> >
> > I understand the documentation allows for it, but I think potential impact
> > on userspace would be more interesting.
>
> Hi David,
>
> This is something that was discussed at LPC'23. I also was proposing a
> separate counter for iommu page tables, but it was noted that we
> specifically have sec_pagetables called this way to include all non
> regular CPU page tables, and we should therefore account for them
> together.
>
> Please also see this discussion from the previous version of this patch series:
> https://lore.kernel.org/all/CAJD7tkb1FqTqwONrp2nphBDkEamQtPCOFm0208H3tp0Gq2OLMQ@mail.gmail.com/
>

Gotcha, I think that makes sense. When sec_pagetables was introduced, I
can understand the need to account for non-primary pagetables separately
because of the long-standing behavior. In that sense, sec_pagetables
becomes a dumping ground for "all other page tables" which IOMMU would
naturally include.

So this looks good to me.

Acked-by: David Rientjes <[email protected]>

2023-12-24 21:49:59

by David Rientjes

[permalink] [raw]
Subject: Re: [PATCH v2 00/10] IOMMU memory observability

On Thu, 30 Nov 2023, Pasha Tatashin wrote:

> 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.
>
> Per-node observability:
> /sys/devices/system/node/nodeN/meminfo
> Node N SecPageTables: 422204 kB
>
> Contains IOMMU and KVM memory memory in the given NUMA node.
>
> Per-node IOMMU only observability:
> /sys/devices/system/node/nodeN/vmstat
> nr_iommu_pages 105555
>
> Contains number of pages IOMMU allocated in the given node.
>
> Accountability: using sec_pagetables cgroup-v2 memory.stat entry.
>
> With the change, iova_stress[1] stops as limit is reached:
>
> # ./iova_stress
> iova space: 0T free memory: 497G
> iova space: 1T free memory: 495G
> iova space: 2T free memory: 493G
> iova space: 3T free memory: 491G
>
> stops as limit is reached.
>

I think this is *very* useful to provide visibility into a significant
amount of memory that we currently cannot observe on a host. It can help
to uncover bugs and shed light onto a particularly large amount of memory
that would otherwise be mysterious.

Joerg, Will, Robin, I think this series would go through the
git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git tree since it
depends on a common framework for all other IOMMU implementations to then
use?

Any concerns about this patch series? It would be very useful for us to
create visibility into this memory.


Pasha: any chance of adding a selftest that can be run that will test the
value of nr_iommu_pages? I could imagine in the future that a bug could
be introduced where either an allocation or free is done through
alloc_pages() directly and its paired alloc/free function now results in a
leak or underflow.

> This series encorporates suggestions that came from the discussion
> at LPC [2].
> ----------------------------------------------------------------------
> [1] https://github.com/soleen/iova_stress
> [2] https://lpc.events/event/17/contributions/1466
> ----------------------------------------------------------------------
> Previous versions
> v1: https://lore.kernel.org/all/[email protected]
> ----------------------------------------------------------------------
>
> Pasha Tatashin (10):
> iommu/vt-d: add wrapper functions for page allocations
> 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/exynos-iommu.c | 14 +-
> drivers/iommu/intel/dmar.c | 10 +-
> drivers/iommu/intel/iommu.c | 47 ++---
> drivers/iommu/intel/iommu.h | 2 -
> drivers/iommu/intel/irq_remapping.c | 10 +-
> drivers/iommu/intel/pasid.c | 12 +-
> drivers/iommu/intel/svm.c | 7 +-
> drivers/iommu/io-pgtable-arm.c | 7 +-
> drivers/iommu/io-pgtable-dart.c | 37 ++--
> drivers/iommu/iommu-pages.h | 231 ++++++++++++++++++++++++
> 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 +
> 22 files changed, 390 insertions(+), 185 deletions(-)
> create mode 100644 drivers/iommu/iommu-pages.h
>
> --
> 2.43.0.rc2.451.g8631bc7472-goog
>
>
>

2023-12-26 18:09:51

by Pasha Tatashin

[permalink] [raw]
Subject: Re: [PATCH v2 04/10] iommu/io-pgtable-dart: use page allocation function provided by iommu-pages.h

On Sun, Dec 24, 2023 at 4:36 PM David Rientjes <[email protected]> wrote:
>
> On Thu, 30 Nov 2023, Pasha Tatashin wrote:
>
> > Convert iommu/io-pgtable-dart.c to use the new page allocation functions
> > provided in iommu-pages.h.
> >
>
> ... and remove unnecessary struct io_pgtable_cfg formal to
> __dart_alloc_pages() while there :)

Added to the commit log.

>
> > Signed-off-by: Pasha Tatashin <[email protected]>
> > Reviewed-by: Janne Grunau <[email protected]>
>
> Acked-by: David Rientjes <[email protected]>

Thank you,
Pasha