diff options
author | Eric Anholt <[email protected]> | 2017-11-28 16:17:16 -0800 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2017-12-01 15:37:28 -0800 |
commit | 0ed952c7e9b811bc11dec64bd4bebcdf4222cc85 (patch) | |
tree | 3f559f6dd6705c0724f3494736fbeebf1d7d96f5 /src/gallium/drivers/vc4/vc4_bufmgr.h | |
parent | 230e646a4013ed5d9c80c54d48ef0ac9ee4edbb0 (diff) |
broadcom/vc4: Use a single-entry cached last_hindex value.
Since almost all BOs will be in one CL at a time, this cache will almost
always hit except for the first usage of the BO in each CL.
This didn't show up as statistically significant on the minetest trace
(n=340), but if I lop off the throttled lobe of the bimodal distribution,
it very clearly does (0.74731% +/- 0.162093%, n=269).
Diffstat (limited to 'src/gallium/drivers/vc4/vc4_bufmgr.h')
-rw-r--r-- | src/gallium/drivers/vc4/vc4_bufmgr.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gallium/drivers/vc4/vc4_bufmgr.h b/src/gallium/drivers/vc4/vc4_bufmgr.h index 4e7b23e0862..e0f6bbcfd8b 100644 --- a/src/gallium/drivers/vc4/vc4_bufmgr.h +++ b/src/gallium/drivers/vc4/vc4_bufmgr.h @@ -39,6 +39,14 @@ struct vc4_bo { uint32_t handle; uint32_t size; + /* This will be read/written by multiple threads without a lock -- you + * should take a snapshot and use it to see if you happen to be in the + * CL's handles at this position, to make most lookups O(1). It's + * volatile to make sure that the compiler doesn't emit multiple loads + * from the address, which would make the lookup racy. + */ + volatile uint32_t last_hindex; + /** Entry in the linked list of buffers freed, by age. */ struct list_head time_list; /** Entry in the per-page-count linked list of buffers freed (by age). */ |