[Mesa-dev] [PATCH v2 03/15] i965: Use a WC map and memcpy for the batch instead of pwrite.
Kenneth Graunke
kenneth at whitecape.org
Thu Sep 14 00:50:51 UTC 2017
On Wednesday, September 13, 2017 3:51:03 PM PDT Matt Turner wrote:
> On 09/13, Kenneth Graunke wrote:
> >We'd like to eliminate the malloc'd shadow copy eventually, but there
> >are still unresolved performance problems. In the meantime, let's at
> >least get rid of pwrite.
>
> I don't know much about this. What is wrong with pwrite, and why is WC
> better?
Mainly, I just wanted to get rid of pwrite. Chris and I talked about
getting rid of our remaining pwrite uses a while ago - I just hadn't
done it yet. Using pwrite is a bit scary these days. It can write
through the CPU caches, and relies on the kernel knowing about domains
and when it's safe to bypass domain changes and the associated flushing
and waiting.
These days, we no longer inform the kernel about domain changes, and
track dirty data in the CPU caches ourselves. We also never use the
CPU caches for writing - only for read-only maps. So, using an ioctl
that trusts in the kernel to figure out how to do this efficiently
doesn't mix with our "do everything ourselves in Mesa" strategy.
WC maps should work just as well, anyway, as we're memcpying large
sections of data in sequential order.
> Does this change performance?
Apparently it does - on Apollolake, OglBatch6 improves by 1.53581% +/-
0.269589% (n=108). That's a bit surprising, but I'll take it...
--Ken
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170913/0b8b3d12/attachment.sig>
More information about the mesa-dev
mailing list