diff options
author | Joerg Roedel <joerg.roedel@amd.com> | 2008-12-12 09:42:39 -0500 |
---|---|---|
committer | Joerg Roedel <joerg.roedel@amd.com> | 2009-01-03 08:11:59 -0500 |
commit | c1858976f5ef05122bb671f678beaf7e1fe1dd74 (patch) | |
tree | 7476166c4dc3851055d9297f51f956f3e3db3bca /arch/x86 | |
parent | 5d31ee7e08b7713596b999a42e67491bdf3665b3 (diff) |
AMD IOMMU: add stats counter for cross-page request
Impact: see number of requests for more than one page in debugfs
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/kernel/amd_iommu.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/x86/kernel/amd_iommu.c b/arch/x86/kernel/amd_iommu.c index 112412d733ab..f5455039b609 100644 --- a/arch/x86/kernel/amd_iommu.c +++ b/arch/x86/kernel/amd_iommu.c | |||
@@ -71,6 +71,7 @@ DECLARE_STATS_COUNTER(cnt_map_sg); | |||
71 | DECLARE_STATS_COUNTER(cnt_unmap_sg); | 71 | DECLARE_STATS_COUNTER(cnt_unmap_sg); |
72 | DECLARE_STATS_COUNTER(cnt_alloc_coherent); | 72 | DECLARE_STATS_COUNTER(cnt_alloc_coherent); |
73 | DECLARE_STATS_COUNTER(cnt_free_coherent); | 73 | DECLARE_STATS_COUNTER(cnt_free_coherent); |
74 | DECLARE_STATS_COUNTER(cross_page); | ||
74 | 75 | ||
75 | static struct dentry *stats_dir; | 76 | static struct dentry *stats_dir; |
76 | static struct dentry *de_isolate; | 77 | static struct dentry *de_isolate; |
@@ -104,6 +105,7 @@ static void amd_iommu_stats_init(void) | |||
104 | amd_iommu_stats_add(&cnt_unmap_sg); | 105 | amd_iommu_stats_add(&cnt_unmap_sg); |
105 | amd_iommu_stats_add(&cnt_alloc_coherent); | 106 | amd_iommu_stats_add(&cnt_alloc_coherent); |
106 | amd_iommu_stats_add(&cnt_free_coherent); | 107 | amd_iommu_stats_add(&cnt_free_coherent); |
108 | amd_iommu_stats_add(&cross_page); | ||
107 | } | 109 | } |
108 | 110 | ||
109 | #endif | 111 | #endif |
@@ -1217,6 +1219,9 @@ static dma_addr_t __map_single(struct device *dev, | |||
1217 | pages = iommu_num_pages(paddr, size, PAGE_SIZE); | 1219 | pages = iommu_num_pages(paddr, size, PAGE_SIZE); |
1218 | paddr &= PAGE_MASK; | 1220 | paddr &= PAGE_MASK; |
1219 | 1221 | ||
1222 | if (pages > 1) | ||
1223 | INC_STATS_COUNTER(cross_page); | ||
1224 | |||
1220 | if (align) | 1225 | if (align) |
1221 | align_mask = (1UL << get_order(size)) - 1; | 1226 | align_mask = (1UL << get_order(size)) - 1; |
1222 | 1227 | ||