summaryrefslogtreecommitdiffstats
path: root/mm/vmstat.c
diff options
context:
space:
mode:
authorPasha Tatashin <pasha.tatashin@soleen.com>2024-04-13 02:25:21 +0200
committerJoerg Roedel <jroedel@suse.de>2024-04-15 14:31:47 +0200
commitbd3520a93a84cd8c3897283e5891a9106fcf5acc (patch)
tree664e71aad879fc1e588f25f29982a1bad2ef45ad /mm/vmstat.c
parentiommu/tegra-smmu: use page allocation function provided by iommu-pages.h (diff)
downloadlinux-bd3520a93a84cd8c3897283e5891a9106fcf5acc.tar.xz
linux-bd3520a93a84cd8c3897283e5891a9106fcf5acc.zip
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 <pasha.tatashin@soleen.com> Acked-by: David Rientjes <rientjes@google.com> Tested-by: Bagas Sanjaya <bagasdotme@gmail.com> Link: https://lore.kernel.org/r/20240413002522.1101315-11-pasha.tatashin@soleen.com Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'mm/vmstat.c')
-rw-r--r--mm/vmstat.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/mm/vmstat.c b/mm/vmstat.c
index db79935e4a54..8507c497218b 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