All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 0/2] swiotlb: Introduce swiotlb device allocation function
@ 2022-04-28 14:14 ` Tianyu Lan
  0 siblings, 0 replies; 33+ messages in thread
From: Tianyu Lan @ 2022-04-28 14:14 UTC (permalink / raw)
  To: hch, m.szyprowski, robin.murphy, michael.h.kelley, kys
  Cc: Tianyu Lan, iommu, linux-kernel, vkuznets, brijesh.singh,
	konrad.wilk, hch, wei.liu, parri.andrea, thomas.lendacky,
	linux-hyperv, andi.kleen, kirill.shutemov

From: Tianyu Lan <Tianyu.Lan@microsoft.com>

Traditionally swiotlb was not performance critical because it was only
used for slow devices. But in some setups, like TDX/SEV confidential
guests, all IO has to go through swiotlb. Currently swiotlb only has a
single lock. Under high IO load with multiple CPUs this can lead to
significant lock contention on the swiotlb lock.

This patchset splits the swiotlb into individual areas which have their
own lock. When there are swiotlb map/allocate request, allocate io tlb
buffer from areas averagely and free the allocation back to the associated
area.

Patch 2 introduces an helper function to allocate bounce buffer
from default IO tlb pool for devices with new IO TLB block unit
and set up IO TLB area for device queues to avoid spinlock overhead.
The area number is set by device driver according queue number.

The network test between traditional VM and Confidential VM.
The throughput improves from ~20Gb/s to ~34Gb/s  with this patchset.

Tianyu Lan (2):
  swiotlb: Split up single swiotlb lock
  Swiotlb: Add device bounce buffer allocation interface

 include/linux/swiotlb.h |  58 +++++++
 kernel/dma/swiotlb.c    | 340 +++++++++++++++++++++++++++++++++++-----
 2 files changed, 362 insertions(+), 36 deletions(-)

-- 
2.25.1


^ permalink raw reply	[flat|nested] 33+ messages in thread

end of thread, other threads:[~2022-04-29 14:26 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-28 14:14 [RFC PATCH 0/2] swiotlb: Introduce swiotlb device allocation function Tianyu Lan
2022-04-28 14:14 ` Tianyu Lan
2022-04-28 14:14 ` [RFC PATCH 1/2] swiotlb: Split up single swiotlb lock Tianyu Lan
2022-04-28 14:14   ` Tianyu Lan
2022-04-28 14:44   ` Robin Murphy
2022-04-28 14:44     ` Robin Murphy
2022-04-28 14:45     ` Christoph Hellwig
2022-04-28 14:45       ` Christoph Hellwig
2022-04-28 14:55       ` Andi Kleen
2022-04-28 14:55         ` Andi Kleen
2022-04-28 15:05         ` Christoph Hellwig
2022-04-28 15:05           ` Christoph Hellwig
2022-04-28 15:16           ` Andi Kleen
2022-04-28 15:16             ` Andi Kleen
2022-04-28 15:07         ` Robin Murphy
2022-04-28 15:07           ` Robin Murphy
2022-04-28 16:02           ` Andi Kleen
2022-04-28 16:02             ` Andi Kleen
2022-04-28 16:59             ` Robin Murphy
2022-04-28 16:59               ` Robin Murphy
2022-04-28 14:56       ` Robin Murphy
2022-04-28 14:56         ` Robin Murphy
2022-04-28 15:54     ` Tianyu Lan
2022-04-28 15:54       ` Tianyu Lan
2022-04-29 14:21     ` [RFC PATCH] swiotlb: Add Child IO TLB mem support Tianyu Lan
2022-04-29 14:21       ` Tianyu Lan
2022-04-29 14:25       ` Tianyu Lan
2022-04-29 14:25         ` Tianyu Lan
2022-04-28 14:14 ` [RFC PATCH 2/2] Swiotlb: Add device bounce buffer allocation interface Tianyu Lan
2022-04-28 14:14   ` Tianyu Lan
2022-04-28 15:50   ` Tianyu Lan
2022-04-28 15:50     ` Tianyu Lan
2022-04-28 17:16   ` kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.