From: Christoph Hellwig <hch@lst.de>
To: Paul Cercueil <paul@crapouillou.net>
Cc: Christoph Hellwig <hch@lst.de>,
Marek Szyprowski <m.szyprowski@samsung.com>,
Robin Murphy <robin.murphy@arm.com>, Nuno Sa <nuno.sa@analog.com>,
Michael Hennerich <Michael.Hennerich@analog.com>,
iommu@lists.linux.dev
Subject: Re: dma_sync_sg_for_device/cpu look very inefficient
Date: Mon, 18 Dec 2023 15:30:03 +0100 [thread overview]
Message-ID: <20231218143003.GA15735@lst.de> (raw)
In-Reply-To: <7166f0da920d494752c89181e6f96688ba8b435e.camel@crapouillou.net>
On Mon, Dec 18, 2023 at 01:32:59PM +0100, Paul Cercueil wrote:
> I am manipulating DMABUFs created with the udmabuf driver, that are 64
> MiB each, on a ZedBoard (which should have ~512 KiB of L2 cache IIRC).
>
> When trying to access them with the CPU, dma_sync_sg_for_cpu() is
> called. What ends up happening, is a cache sync for each one of the (up
> to) 16 thousand pages that back up the DMABUF, which obviously takes a
> huge amount of time, tanking performance.
>
> My guess (probably very naïve) is that if the total length of the SG is
> equal or bigger than the size of the wider non-coherent cache, it would
> be much better to just flush the whole data cache.
IFF we regularly ѕync huge amount of data a complete flush is probably
going to be more efficient. But why are we doing that to start with?
Ownership needs to transfer when the data is accessed, and when you
regularly access 16.000 pages you're probably got other performance
problems to start with.
next prev parent reply other threads:[~2023-12-18 14:30 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-18 12:32 dma_sync_sg_for_device/cpu look very inefficient Paul Cercueil
2023-12-18 14:30 ` Christoph Hellwig [this message]
2023-12-18 14:40 ` Lucas Stach
2023-12-18 15:02 ` Paul Cercueil
2023-12-18 15:01 ` Paul Cercueil
2023-12-18 15:16 ` 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=20231218143003.GA15735@lst.de \
--to=hch@lst.de \
--cc=Michael.Hennerich@analog.com \
--cc=iommu@lists.linux.dev \
--cc=m.szyprowski@samsung.com \
--cc=nuno.sa@analog.com \
--cc=paul@crapouillou.net \
--cc=robin.murphy@arm.com \
/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 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.