[Mesa-dev] [PATCH 4/4] i965/drm: Purge the bucket when its cached buffer is evicted
James Xiong
james.xiong at intel.com
Mon May 7 19:07:46 UTC 2018
On Sat, 5 May 2018 08:55:24 +0100
Chris Wilson <chris at chris-wilson.co.uk> wrote:
> Quoting James Xiong (2018-05-05 01:56:05)
> > From: "Xiong, James" <james.xiong at intel.com>
> >
> > When one of cached buffers is found to be evicted by kernel,
> > most likely the buffers freed earlier than this buffer are
> > gone too, go through the cached list in the bucket and purge.
>
> The order in this list bears little relevance to the MRU lists in the
> kernel. (I wish it did.) So why? The list will be processed in due
> course, so why pay the cost now? Even in the worst case, they will be
> cleaned up as we are in the middle of processing the lists.
> -Chris
This is the existing logic, I think because the free time is the only
hint indicates whether a buffer is evicted or not in the user land,
maybe we could associate a fence with cached buffer in the future or
something like that, but at the moment i don't know how to improve it,
I just follow and make it work with the new implementation, the idea
is still the same as before.
The cleanup routine(cleanup_bo_cache?) is only triggered when a buffer's
ref goes down to 0, my guess is that it's not frequent enough so that we
need the purge to keep the cached list short maybe? Anyway, if we do
need to improve this part, we could do it in another patch.
More information about the mesa-dev
mailing list