From: "Christian König" <christian.koenig@amd.com>
To: Robin Murphy <robin.murphy@arm.com>,
Kelly Devilliv <kelly.devilliv@outlook.com>,
"joro@8bytes.org" <joro@8bytes.org>,
"will@kernel.org" <will@kernel.org>
Cc: "iommu@lists.linux.dev" <iommu@lists.linux.dev>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: dma_map_resource() has a bad performance in pcie peer to peer transactions when iommu enabled in Linux
Date: Wed, 4 Oct 2023 08:26:26 +0200 [thread overview]
Message-ID: <f7ee378e-6fd4-620f-abf9-2a8aa3643f94@amd.com> (raw)
In-Reply-To: <13d73200-2d53-7f95-fb93-5b5f422251cd@arm.com>
Am 02.10.23 um 22:08 schrieb Robin Murphy:
> On 2023-09-26 16:30, Kelly Devilliv wrote:
>> [SNIP]
>> Hi Robin,
>>
>> Is there any chance to extend the dma_map_resource() API as discussed
>> above?
>
> As Christoph says, no. There are things one could do to make a
> minimal-effort bodge in a downstream kernel, but upstream we already
> have a dedicated PCI peer-to-peer API, so we have no reason and no
> desire to also attempt to crowbar P2P support into a different API
> which isn't designed for it. Sure there exist some drivers that went
> ahead of the game and did their own thing before we realised that
> dma_map_resource() just fundamentally wouldn't be a good fit for P2P
> as initially suggested, but all that means is that if they're still
> doing that today, they're now lagging behind and it's on them to
> update to the newer solution if they want to benefit from all its
> goodness. Note that this isn't just maintainer semantics or relatively
> straightforward things like memory attributes; I believe the proper
> API can also handle stuff like direct P2P when you do have an IOMMU
> but don't have ACS upstream redirect, which dma_map_resource() could
> never do.
The problem is that the new API requires to have struct pages for PCIe
resources which the graphics drivers absolutely don't want to do.
Allocating struct pages for memory mapped I/O simply doesn't make to
much sense when the underlying resource is not even memory.
Regards,
Christian.
>
> Thanks,
> Robin.
next prev parent reply other threads:[~2023-10-04 6:26 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-26 15:30 Kelly Devilliv
2023-10-02 6:30 ` Christoph Hellwig
2023-10-02 20:08 ` Robin Murphy
2023-10-04 6:26 ` Christian König [this message]
-- strict thread matches above, loose matches on Subject: below --
2023-09-25 14:17 Kelly Devilliv
2023-09-25 17:58 ` Christian König
2023-09-25 3:59 Kelly Devilliv
2023-09-25 11:15 ` Robin Murphy
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=f7ee378e-6fd4-620f-abf9-2a8aa3643f94@amd.com \
--to=christian.koenig@amd.com \
--cc=iommu@lists.linux.dev \
--cc=joro@8bytes.org \
--cc=kelly.devilliv@outlook.com \
--cc=linux-kernel@vger.kernel.org \
--cc=robin.murphy@arm.com \
--cc=will@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
all inboxes | Powered by JetHome®