[Mesa-dev] [PATCH 2/2] i965: Reduce the frequency of madvise calls

Eric Anholt eric at anholt.net
Fri Oct 20 20:15:00 UTC 2017


Chris Wilson <chris at chris-wilson.co.uk> writes:

> We can reduce the frequency of calling madvise by only using it for
> buffers that are inactive (busy buffers will be pinned by they use by the
> GPU, so should not significantly add to mempressure, but will still be
> reaped by our timed cache.)
>
> v2: Remember about APPLE_purgeable_memory that also calls
> brw_bo_madvise() and so leave the buffer as purgeable needing to be
> recovered prior to use.

I don't think this is a good idea.  We should be marking our buffers
purgeable as they enter the cache, because the point of purgeable is to
make it so that when the application goes from being busy to being idle,
the buffers that used to be in active use can be evicted by the kernel.
In steady state rendering, we don't need madvise at all because we'll
free inactive buffers in a second anyway.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20171020/37043334/attachment.sig>


More information about the mesa-dev mailing list