Thread (31 messages) 31 messages, 6 authors, 2022-06-01

Re: [PATCH 09/15] swiotlb: make the swiotlb_init interface more useful

From: Nathan Chancellor <nathan@kernel.org>
Date: 2022-06-01 18:13:17
Also in: linux-arm-kernel, linux-hyperv, linux-iommu, linux-mips, linux-pci, linux-riscv, linux-s390, xen-devel
Subsystem: dma mapping helpers, the rest · Maintainers: Marek Szyprowski, Linus Torvalds

On Wed, Jun 01, 2022 at 07:57:43PM +0200, Christoph Hellwig wrote:
On Wed, Jun 01, 2022 at 10:46:54AM -0700, Nathan Chancellor wrote:
quoted
On Wed, Jun 01, 2022 at 07:34:41PM +0200, Christoph Hellwig wrote:
quoted
Can you send me the full dmesg and the content of
/sys/kernel/debug/swiotlb/io_tlb_nslabs for a good and a bad boot?
Sure thing, they are attached! If there is anything else I can provide
or test, I am more than happy to do so.
Nothing interesting.  But the performance numbers almost look like
swiotlb=force got ignored before (even if I can't explain why).
I was able to get my performance back with this diff but I don't know if
this is a hack or a proper fix in the context of the series.
diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c
index dfa1de89dc94..0bfb2fe3d8c5 100644
--- a/kernel/dma/swiotlb.c
+++ b/kernel/dma/swiotlb.c
@@ -276,7 +276,7 @@ void __init swiotlb_init_remap(bool addressing_limit, unsigned int flags,
 		      __func__, alloc_size, PAGE_SIZE);
 
 	swiotlb_init_io_tlb_mem(mem, __pa(tlb), nslabs, false);
-	mem->force_bounce = flags & SWIOTLB_FORCE;
+	mem->force_bounce = swiotlb_force_bounce || (flags & SWIOTLB_FORCE);
 
 	if (flags & SWIOTLB_VERBOSE)
 		swiotlb_print_info();
Do you get a similar performance with the new kernel without
swiotlb=force as the old one with that argument by any chance?
I'll see if I can test that, as I am not sure I have control over those
cmdline arguments.

Cheers,
Nathan
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help