From: Tianyu Lan <ltykernel@gmail.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: parri.andrea@gmail.com, thomas.lendacky@amd.com,
wei.liu@kernel.org, Tianyu Lan <Tianyu.Lan@microsoft.com>,
linux-hyperv@vger.kernel.org, konrad.wilk@oracle.com,
linux-kernel@vger.kernel.org, michael.h.kelley@microsoft.com,
iommu@lists.linux-foundation.org, kirill.shutemov@intel.com,
andi.kleen@intel.com, brijesh.singh@amd.com, vkuznets@redhat.com,
kys@microsoft.com, robin.murphy@arm.com, hch@lst.de
Subject: Re: [RFC PATCH V2 1/2] swiotlb: Add Child IO TLB mem support
Date: Mon, 16 May 2022 21:08:58 +0800 [thread overview]
Message-ID: <ad2f9bcb-1aa7-0a35-942f-6a5f674823fe@gmail.com> (raw)
In-Reply-To: <YoH+mbxQAp/2XGyG@infradead.org>
On 5/16/2022 3:34 PM, Christoph Hellwig wrote:
> I don't really understand how 'childs' fit in here. The code also
> doesn't seem to be usable without patch 2 and a caller of the
> new functions added in patch 2, so it is rather impossible to review.
Hi Christoph:
OK. I will merge two patches and add a caller patch. The motivation
is to avoid global spin lock when devices use swiotlb bounce buffer and
this introduces overhead during high throughput cases. In my test
environment, current code can achieve about 24Gb/s network throughput
with SWIOTLB force enabled and it can achieve about 40Gb/s without
SWIOTLB force. Storage also has the same issue.
Per-device IO TLB mem may resolve global spin lock issue among
devices but device still may have multi queues. Multi queues still need
to share one spin lock. This is why introduce child or IO tlb areas in
the previous patches. Each device queues will have separate child IO TLB
mem and single spin lock to manage their IO TLB buffers.
Otherwise, global spin lock still cost cpu usage during high
throughput even when there is performance regression. Each device queues
needs to spin on the different cpus to acquire the global lock. Child IO
TLB mem also may resolve the cpu issue.
>
> Also:
>
> 1) why is SEV/TDX so different from other cases that need bounce
> buffering to treat it different and we can't work on a general
> scalability improvement
Other cases also have global spin lock issue but it depends on
whether hits the bottleneck. The cpu usage issue may be ignored.
> 2) per previous discussions at how swiotlb itself works, it is
> clear that another option is to just make pages we DMA to
> shared with the hypervisor. Why don't we try that at least
> for larger I/O?
For confidential VM(Both TDX and SEV), we need to use bounce
buffer to copy between private memory that hypervisor can't
access directly and shared memory. For security consideration,
confidential VM should not share IO stack DMA pages with
hypervisor directly to avoid attack from hypervisor when IO
stack handles the DMA data.
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
next prev parent reply other threads:[~2022-05-16 13:09 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-02 12:54 [RFC PATCH V2 0/2] swiotlb: Add child io tlb mem support Tianyu Lan
2022-05-02 12:54 ` [RFC PATCH V2 1/2] swiotlb: Add Child IO TLB " Tianyu Lan
2022-05-16 7:34 ` Christoph Hellwig
2022-05-16 13:08 ` Tianyu Lan [this message]
2022-05-30 1:52 ` Michael Kelley (LINUX) via iommu
2022-05-31 7:16 ` hch
2022-05-31 14:13 ` Michael Kelley (LINUX) via iommu
2022-05-02 12:54 ` [RFC PATCH V2 2/2] Swiotlb: Add device bounce buffer allocation interface Tianyu Lan
2022-05-09 11:49 ` [RFC PATCH V2 0/2] swiotlb: Add child io tlb mem support 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=ad2f9bcb-1aa7-0a35-942f-6a5f674823fe@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=michael.h.kelley@microsoft.com \
--cc=parri.andrea@gmail.com \
--cc=robin.murphy@arm.com \
--cc=thomas.lendacky@amd.com \
--cc=tiala@microsoft.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