[Mesa-dev] [PATCH 0/8] i965: Don't recycle BOs until they are idle

Jason Ekstrand jason at jlekstrand.net
Wed Jun 13 20:26:52 UTC 2018


The current BO cache puts BOs back into the recycle bucket the moment the
refcount hits zero.  If the BO is busy, we just don't re-use it until it
isn't or we re-use it for a render target which we assume will be used
first for drawing.  This patch series reworks the way the BO cache works a
bit so that we don't ever recycle a busy BO.  On the down side, it means
that we don't get the "keep busy BOs busy" heuristic (which we have no
proof actually helps).  On the up side, we can now easily use a MRU
heuristic instead of round-robin for all buffers and not just the busy
ones.  Will this be an improvement, a regression or a wash?  I don't know
but I doubt it will have a major effect one way or another.

Jason Ekstrand (8):
  i965/bufmgr: Bail early in bo_busy if the BO is flagged idle
  i965/miptree: Stop setting BO_ALLOC_BUSY
  i965/bufmgr: Drop the BO_ALLOC_BUSY flag
  i965/bufmgr: Add a garbage collection mechanism
  i965/batch: Use brw_bo_unreference_bos_when_idle
  i965: Call intel_finish before destroying the context
  i965/bufmgr: Don't allow busy BOs to be returned to the pool
  i965/bufmgr: Allocate from the tail of the bucket free list

 src/mesa/drivers/dri/i965/brw_bufmgr.c        | 186 +++++++++++++-----
 src/mesa/drivers/dri/i965/brw_bufmgr.h        |  18 +-
 src/mesa/drivers/dri/i965/brw_context.c       |   8 +
 src/mesa/drivers/dri/i965/intel_batchbuffer.c |   8 +-
 src/mesa/drivers/dri/i965/intel_fbo.c         |   2 +-
 src/mesa/drivers/dri/i965/intel_mipmap_tree.c |  29 ++-
 src/mesa/drivers/dri/i965/intel_mipmap_tree.h |   9 -
 src/mesa/drivers/dri/i965/intel_screen.c      |   2 +-
 .../drivers/dri/i965/intel_tex_validate.c     |   2 +-
 9 files changed, 182 insertions(+), 82 deletions(-)

-- 
2.17.1



More information about the mesa-dev mailing list