linux-hyperv.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tianyu Lan <ltykernel@gmail.com>
To: hch@infradead.org, m.szyprowski@samsung.com,
	robin.murphy@arm.com, michael.h.kelley@microsoft.com,
	kys@microsoft.com
Cc: Tianyu Lan <Tianyu.Lan@microsoft.com>,
	iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org,
	vkuznets@redhat.com, brijesh.singh@amd.com,
	konrad.wilk@oracle.com, hch@lst.de, wei.liu@kernel.org,
	parri.andrea@gmail.com, thomas.lendacky@amd.com,
	linux-hyperv@vger.kernel.org, andi.kleen@intel.com,
	kirill.shutemov@intel.com
Subject: [RFC PATCH 0/2] swiotlb: Introduce swiotlb device allocation function
Date: Thu, 28 Apr 2022 10:14:27 -0400	[thread overview]
Message-ID: <20220428141429.1637028-1-ltykernel@gmail.com> (raw)

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


             reply	other threads:[~2022-04-28 14:14 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-28 14:14 Tianyu Lan [this message]
2022-04-28 14:14 ` [RFC PATCH 1/2] swiotlb: Split up single swiotlb lock Tianyu Lan
2022-04-28 14:44   ` Robin Murphy
2022-04-28 14:45     ` Christoph Hellwig
2022-04-28 14:55       ` Andi Kleen
2022-04-28 15:05         ` Christoph Hellwig
2022-04-28 15:16           ` Andi Kleen
2022-04-28 15:07         ` Robin Murphy
2022-04-28 16:02           ` Andi Kleen
2022-04-28 16:59             ` Robin Murphy
2022-04-28 14:56       ` Robin Murphy
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:25       ` Tianyu Lan
2022-04-28 14:14 ` [RFC PATCH 2/2] Swiotlb: Add device bounce buffer allocation interface Tianyu Lan
2022-04-28 15:50   ` Tianyu Lan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220428141429.1637028-1-ltykernel@gmail.com \
    --to=ltykernel@gmail.com \
    --cc=Tianyu.Lan@microsoft.com \
    --cc=andi.kleen@intel.com \
    --cc=brijesh.singh@amd.com \
    --cc=hch@infradead.org \
    --cc=hch@lst.de \
    --cc=iommu@lists.linux-foundation.org \
    --cc=kirill.shutemov@intel.com \
    --cc=konrad.wilk@oracle.com \
    --cc=kys@microsoft.com \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=michael.h.kelley@microsoft.com \
    --cc=parri.andrea@gmail.com \
    --cc=robin.murphy@arm.com \
    --cc=thomas.lendacky@amd.com \
    --cc=vkuznets@redhat.com \
    --cc=wei.liu@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).