]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
swiotlb: dump used and total slots when swiotlb buffer is full
authorDongli Zhang <dongli.zhang@oracle.com>
Tue, 16 Apr 2019 23:48:19 +0000 (07:48 +0800)
committerBrian Maly <brian.maly@oracle.com>
Fri, 10 May 2019 21:23:57 +0000 (17:23 -0400)
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>
Orabug: 29637525

(cherry picked from commit 83ca259489409a1fe8a83dad83a82f32174d4f31)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Conflicts:
    kernel/dma/swiotlb.c does not exist.

Signed-off-by: Dongli Zhang <dongli.zhang@oracle.com>
Reviewed-By: Joe Jin <joe.jin@oracle.com>
Signed-off-by: Brian Maly <brian.maly@oracle.com>
lib/swiotlb.c

index c9d2b32c70b5393c3c67386ad8874ea39cf3ca4a..d08ce286e1d2895c4059142ae358b2bd187229ea 100644 (file)
@@ -526,7 +526,8 @@ phys_addr_t swiotlb_tbl_map_single(struct device *hwdev,
 not_found:
        spin_unlock_irqrestore(&io_tlb_lock, flags);
        if (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 SWIOTLB_MAP_ERROR;
 found:
        io_tlb_used += nslots;