summaryrefslogtreecommitdiff
path: root/kernel/dma
diff options
context:
space:
mode:
authorDongli Zhang <dongli.zhang@oracle.com>2019-04-05 04:15:25 +0300
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2019-04-10 19:53:22 +0300
commit83ca259489409a1fe8a83dad83a82f32174d4f31 (patch)
treefb8b7a91f1bf4cd34fa47edaa7d7e0659d2c8ea9 /kernel/dma
parent22cb45d7692ab502dd47dc5a607b3af240ee1e37 (diff)
downloadlinux-83ca259489409a1fe8a83dad83a82f32174d4f31.tar.xz
swiotlb: dump used and total slots when swiotlb buffer is full
So far the kernel only prints the requested size if swiotlb buffer if full. It is not possible to know whether it is simply an out of buffer, or it is because swiotlb cannot allocate buffer with the requested size due to fragmentation. As 'io_tlb_used' is available since commit 71602fe6d4e9 ("swiotlb: add debugfs to track swiotlb buffer usage"), both 'io_tlb_used' and 'io_tlb_nslabs' are printed when swiotlb buffer is full. Signed-off-by: Dongli Zhang <dongli.zhang@oracle.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Diffstat (limited to 'kernel/dma')
-rw-r--r--kernel/dma/swiotlb.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c
index 2b0c8fd9658e..82c767374c70 100644
--- a/kernel/dma/swiotlb.c
+++ b/kernel/dma/swiotlb.c
@@ -533,7 +533,8 @@ phys_addr_t swiotlb_tbl_map_single(struct device *hwdev,
not_found:
spin_unlock_irqrestore(&io_tlb_lock, flags);
if (!(attrs & DMA_ATTR_NO_WARN) && printk_ratelimit())
- dev_warn(hwdev, "swiotlb buffer is full (sz: %zd bytes)\n", size);
+ dev_warn(hwdev, "swiotlb buffer is full (sz: %zd bytes), total %lu, used %lu\n",
+ size, io_tlb_nslabs, io_tlb_used);
return DMA_MAPPING_ERROR;
found:
io_tlb_used += nslots;