diff options
author | Petr Tesarik <petr.tesarik.ext@huawei.com> | 2023-04-20 12:58:58 +0300 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2023-04-20 15:51:41 +0300 |
commit | ec274aff21b6a94c7973384ca80a503c1bc3b173 (patch) | |
tree | 03fd86f07ec5b3585fda7e993e9443f75ad86b63 /include | |
parent | 8b0977ecc8b30a30966e76fcb64cef5041626b02 (diff) | |
download | linux-ec274aff21b6a94c7973384ca80a503c1bc3b173.tar.xz |
swiotlb: Omit total_used and used_hiwater if !CONFIG_DEBUG_FS
The tracking of used_hiwater adds an atomic operation to the hot
path. This is acceptable only when debugging the kernel. To make
sure that the fields can never be used by mistake, do not even
include them in struct io_tlb_mem if CONFIG_DEBUG_FS is not set.
The build fails after doing that. To fix it, it is necessary to
remove all code specific to debugfs and instead provide a stub
implementation of swiotlb_create_debugfs_files(). As a bonus, this
change allows to remove one __maybe_unused attribute.
Signed-off-by: Petr Tesarik <petr.tesarik.ext@huawei.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/swiotlb.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h index 6dc4598d2260..44767844e12b 100644 --- a/include/linux/swiotlb.h +++ b/include/linux/swiotlb.h @@ -107,8 +107,10 @@ struct io_tlb_mem { unsigned int area_nslabs; struct io_tlb_area *areas; struct io_tlb_slot *slots; +#ifdef CONFIG_DEBUG_FS atomic_long_t total_used; atomic_long_t used_hiwater; +#endif }; extern struct io_tlb_mem io_tlb_default_mem; |