summaryrefslogtreecommitdiffstats
path: root/include/linux/swiotlb.h
diff options
context:
space:
mode:
authorZhangPeng <zhangpeng362@huawei.com>2024-01-09 15:04:56 +0800
committerChristoph Hellwig <hch@lst.de>2024-02-28 05:31:38 -0800
commit02e765697038c596dc4a1126a13b018608365d81 (patch)
treec726728ee0a1ca0d78920ecbb3d384086b098ad7 /include/linux/swiotlb.h
parentcf1182944c7cc9f1c21a8a44e0d29abe12527412 (diff)
downloadlinux-02e765697038c596dc4a1126a13b018608365d81.tar.gz
linux-02e765697038c596dc4a1126a13b018608365d81.tar.bz2
linux-02e765697038c596dc4a1126a13b018608365d81.zip
swiotlb: add debugfs to track swiotlb transient pool usage
Introduce a new debugfs interface io_tlb_transient_nslabs. The device driver can create a new swiotlb transient memory pool once default memory pool is full. To export the swiotlb transient memory pool usage via debugfs would help the user estimate the size of transient swiotlb memory pool or analyze device driver memory leak issue. Signed-off-by: ZhangPeng <zhangpeng362@huawei.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'include/linux/swiotlb.h')
-rw-r--r--include/linux/swiotlb.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h
index ecde0312dd52..ea23097e351f 100644
--- a/include/linux/swiotlb.h
+++ b/include/linux/swiotlb.h
@@ -120,6 +120,8 @@ struct io_tlb_pool {
* debugfs.
* @used_hiwater: The high water mark for total_used. Used only for reporting
* in debugfs.
+ * @transient_nslabs: The total number of slots in all transient pools that
+ * are currently used across all areas.
*/
struct io_tlb_mem {
struct io_tlb_pool defpool;
@@ -137,6 +139,7 @@ struct io_tlb_mem {
#ifdef CONFIG_DEBUG_FS
atomic_long_t total_used;
atomic_long_t used_hiwater;
+ atomic_long_t transient_nslabs;
#endif
};