All of lore.kernel.org
 help / color / mirror / Atom feed
* dma_sync_sg_for_device/cpu look very inefficient
@ 2023-12-18 12:32 Paul Cercueil
  2023-12-18 14:30 ` Christoph Hellwig
  2023-12-18 15:16 ` Robin Murphy
  0 siblings, 2 replies; 6+ messages in thread
From: Paul Cercueil @ 2023-12-18 12:32 UTC (permalink / raw)
  To: Christoph Hellwig, Marek Szyprowski, Robin Murphy
  Cc: Nuno Sa, Michael Hennerich, iommu

Hi,

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.

Thoughts?

Cheers,
-Paul

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-12-18 15:16 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-18 12:32 dma_sync_sg_for_device/cpu look very inefficient Paul Cercueil
2023-12-18 14:30 ` Christoph Hellwig
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

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.