libdrm_radeon: Optimize reloc writing to do less looping.
PATCH 1/1 libdrm_radeon: Optimize reloc writing to do less looping.
Bit has table will be first checked from BO if we can quarentee this BO is not in this cs already. When bo is emited the reference to cs is removed with bit operations.
To quarentee that there is no other cs with same id number of CS that can have id is limited to number of bits in unsigned long.
This optimization decreases cs_write_reloc share of torcs profiling from 4.3% to 2.6%.
--- radeon/radeon_bo_gem.c | 1 + radeon/radeon_bo_int.h | 2 +- radeon/radeon_cs_gem.c | 111 ++++++++++++++++++++++++++++++++++------------- 3 files changed, 82 insertions(+), 32 deletions(-)
radeon/radeon_bo_gem.c +1 -0
@@ -80,6 +80,7 @@ static struct radeon_bo *bo_open(struct radeon_bo_manager *bom, bo->base.domains = domains; bo->base.flags = flags; bo->base.ptr =NULL ; + bo->base.referenced_in_cs =0 ; bo->map_count =0 ;if (handle) {struct drm_gem_open open_arg;
radeon/radeon_bo_int.h +1 -1
@@ -17,7 +17,7 @@ struct radeon_bo_int {unsigned cref;struct radeon_bo_manager *bom;uint32_t space_accounted; -uint32_t referenced_in_cs; +unsigned long referenced_in_cs; };/* bo functions */
radeon/radeon_cs_gem.c +80 -31
165 lines not on this page · raw message
Signature · 10 lines
1.6.3.3 ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev --
PATCH 1/1 libdrm_radeon: Optimize reloc writing to do less looping.
Bit has table will be first checked from BO if we can quarentee this BO is not in this cs already. When bo is emited the reference to cs is removed with bit operations.
To quarentee that all cs ids are unique number of ids is limited to 32. If application uses more than 32 cs objects extra cs don't get benefits from bit hash function.
This optimization decreases cs_write_reloc share of torcs profiling from 4.3% to 2.6%.
V2:
* Fix data type for referenced_in_cs to be uint32_t
* Use gcc builtin_ctz to find the first zero bit.
--- radeon/radeon_bo_gem.c | 1 + radeon/radeon_cs_gem.c | 118 +++++++++++++++++++++++++++++++++++------------- 2 files changed, 88 insertions(+), 31 deletions(-)
radeon/radeon_bo_gem.c +1 -0
@@ -80,6 +80,7 @@ static struct radeon_bo *bo_open(struct radeon_bo_manager *bom, bo->base.domains = domains; bo->base.flags = flags; bo->base.ptr =NULL ; + bo->base.referenced_in_cs =0 ; bo->map_count =0 ;if (handle) {struct drm_gem_open open_arg;
radeon/radeon_cs_gem.c +87 -31
172 lines not on this page · raw message
Signature · 10 lines
1.6.3.3 ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev --