On Thu, Nov 06, 2014 at 07:36:55AM +0000, Chris Wilson wrote: > On Wed, Nov 05, 2014 at 02:42:00PM -0800, Volkin, Bradley D wrote: > > For this part, I've got an implementation that works ok but one difference is > > that if we stop submitting batches, and therefore stop calling batch_pool_get, > > we stop moving buffers to the batch pool's inactive list. This means some buffers > > don't get marked purgeable even when they are. The solution that I see is to > > add a function to do the batch pool active -> inactive work and then call that > > from the appropriate place(s), but that seems to defeat the purpose of the > > proposed change. Suggestions? > > Just mark them always as purgeable. Yeah the trick with purgeable is that the shrinker will wait for the buffers to retire if they're still active. So you can mark the purgeable right after the move_to_active call. Then the only part that doesn't happen automatically is the batch-pool internal accounting. But we also don't really care about that until we want a new shadow batch. libdrm works the same way btw: Userspace grabs a new batch (from the cache hopefully, setting willneed again), builds the cmd stream and submits it. Then it frees the buffer right away, libdrm puts it into the bo cache and also marks it as purgeable right away. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list Intel-gfx@xxxxxxxxxxxxxxxxxxxxx http://lists.freedesktop.org/mailman/listinfo/intel-gfx