From: "Petr Tesařík" <petr@tesarici.cz>
To: "hch@lst.de" <hch@lst.de>
Cc: Michael Kelley <mhklinux@outlook.com>,
"robin.murphy@arm.com" <robin.murphy@arm.com>,
"joro@8bytes.org" <joro@8bytes.org>,
"will@kernel.org" <will@kernel.org>,
"jgross@suse.com" <jgross@suse.com>,
"sstabellini@kernel.org" <sstabellini@kernel.org>,
"oleksandr_tyshchenko@epam.com" <oleksandr_tyshchenko@epam.com>,
"m.szyprowski@samsung.com" <m.szyprowski@samsung.com>,
"iommu@lists.linux.dev" <iommu@lists.linux.dev>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Subject: Re: [RFC 1/1] swiotlb: Reduce calls to swiotlb_find_pool()
Date: Mon, 1 Jul 2024 07:47:37 +0200 [thread overview]
Message-ID: <20240701072140.182aa267@meshulam.tesarici.cz> (raw)
In-Reply-To: <20240701043615.GB26372@lst.de>
On Mon, 1 Jul 2024 06:36:15 +0200
"hch@lst.de" <hch@lst.de> wrote:
> On Sun, Jun 30, 2024 at 02:02:52PM +0000, Michael Kelley wrote:
> > 1) Rename is_swiotlb_buffer() to swiotlb_find_pool(), since it
> > now returns a pool. A NULL return value indicates that the
> > paddr is not an swiotlb buffer.
> >
> > 2) Similarly, rename is_xen_swiotlb_buffer() to
> > xen_swiotlb_find_pool()
> >
> > 3) The existing swiotlb_find_pool() has the same function signature,
> > but it is used only where the paddr is known to be an swiotlb buffer
> > and hence always succeeds. Rename it to __swiotlb_find_pool() as
> > the "internal" version of swiotlb_find_pool().
>
> Sounds good.
Agreed. Most importantly, the "nice" name swiotlb_find_pool() is used
for external users. The difference between swiotlb_find_pool() and
__swiotlb_find_pool() is that the former can be used with any device,
and the latter (internal) only with devices that make some use of
swiotlb. The main reason to keep them separate is that the internal
function should not be inlined if CONFIG_SWIOTLB_DYNAMIC=y.
I hope somebody finds my explanation useful when they touch the code
again in a few years from now. ;-)
> > 4) Do you still want is_swiotlb_buffer() as a trivial wrapper around
> > the new swiotlb_find_pool(), for use solely in dma_direct_need_sync()
> > where only a Boolean is needed and not the pool?
>
> If there is really just a single caller left we can skip the wrapper,
> otherwise it might be handy.
AFAICS dma_direct_need_sync() is the only such place.
Petr T
next prev parent reply other threads:[~2024-07-01 5:47 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-07 3:14 mhkelley58
2024-06-26 23:58 ` Michael Kelley
2024-06-27 6:02 ` hch
2024-06-27 6:52 ` Petr Tesařík
2024-06-27 14:59 ` Michael Kelley
2024-06-27 15:25 ` hch
2024-06-27 16:02 ` Michael Kelley
2024-06-28 6:01 ` hch
2024-06-28 7:47 ` Petr Tesařík
2024-06-29 15:55 ` Michael Kelley
2024-06-30 5:55 ` hch
2024-06-30 14:02 ` Michael Kelley
2024-07-01 4:36 ` hch
2024-07-01 5:47 ` Petr Tesařík [this message]
2024-06-27 7:20 ` Petr Tesařík
2024-06-27 15:04 ` Michael Kelley
2024-06-29 15:53 ` Michael Kelley
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=20240701072140.182aa267@meshulam.tesarici.cz \
--to=petr@tesarici.cz \
--cc=hch@lst.de \
--cc=iommu@lists.linux.dev \
--cc=jgross@suse.com \
--cc=joro@8bytes.org \
--cc=linux-kernel@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=mhklinux@outlook.com \
--cc=oleksandr_tyshchenko@epam.com \
--cc=robin.murphy@arm.com \
--cc=sstabellini@kernel.org \
--cc=will@kernel.org \
--cc=xen-devel@lists.xenproject.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®