freedreno: align pipe_resource and sampler_view allocations to cachelines
This eliminates false sharing for atomics.
See also !11618 (merged).
Attached are benchmark results (n=100) using piglit's drawoverhead. Results were collected on a lazor/sc7180 with GPU frequency clamped to min, CPU governor set to performance, taskset running drawoverhead only on the two big cores, and FD_MESA_DEBUG=nohw
.
cd /sys/devices/platform/soc@0/5000000.gpu/devfreq/5000000.gpu
cat cat min_freq > max_freq
cpupower -c 7 frequency-set -g performance
cd ~/projects/piglit
for x in `seq 1 100`; do
PIGLIT_PLATFORM=gbm FD_MESA_DEBUG=nohw taskset 0xc0 mesa-release ./bin/drawoverhead ;
done | tee -a baseline
-
baseline with which to compare changes
-
pipe_sampler_view-only - results with only the pipe_sampler_view allocations aligned
-
pipe_resource-only - results with only the pipe_resource allocations aligned
-
both - results with both pipe_sampler_view and pipe_resource allocations aligned
-
compare.sh - bash script to runs ministat to produce results.
Num | Name | pipe_resource only | pipe_sampler_view only | both |
---|---|---|---|---|
1 | DrawArrays ( 1 VBO 0 UBO 0 ) w/ no state change | no diff | no diff | no diff |
2 | DrawElements ( 1 VBO 0 UBO 0 ) w/ no state change | no diff | 1.47508% +/- 1.2081% | no diff |
3 | DrawElements (16 VBO 8 UBO 16 Tex) w/ no state change | no diff | no diff | no diff |
4 | DrawElements ( 1 VBO 1 UBO 1 Tex) w/ buffer replacement change | -9.40207% +/- 0.329597% | 0.38932% +/- 0.312642% | -9.4118% +/- 0.272046% |
5 | DrawElements ( 1 VBO 8 UBO 8 Tex) w/ 1 vertex attrib change | 1.38642% +/- 0.940892% | no diff | no diff |
6 | DrawElements (16 VBO 8 UBO 8 Tex) w/ 16 vertex attribs change | -1.10092% +/- 0.809795% | no diff | 1.42336% +/- 1.03854% |
7 | DrawElements ( 1 VBO 0 UBO 0 ) w/ shader program change | no diff | no diff | no diff |
8 | DrawElements ( 8 VBO 8 UBO 8 Tex) w/ shader program change | no diff | no diff | no diff |
9 | DrawElements ( 8 VBO 8 UBO 1 Tex) w/ 1/1 texture change | no diff | -3.66571% +/- 3.02305% | no diff |
10 | DrawElements ( 8 VBO 8 UBO 8 Tex) w/ 1/8 texture change | no diff | no diff | no diff |
11 | DrawElements ( 8 VBO 8 UBO 8 Tex) w/ 8/8 textures change | 4.20436% +/- 1.17252% | no diff | 5.03485% +/- 1.14465% |
12 | DrawElements ( 8 VBO 8 UBO 1 TBO) w/ 1/1 TBO change | no diff | no diff | no diff |
13 | DrawElements ( 8 VBO 8 UBO 8 TBO) w/ 1/8 TBO change | no diff | -2.91389% +/- 1.46059% | no diff |
14 | DrawElements ( 8 VBO 8 UBO 8 TBO) w/ 8/8 TBOs change | 1.96871% +/- 0.953074% | no diff | 1.59674% +/- 0.998286% |
15 | DrawElements ( 8 VBO 8 UBO 1 Img) w/ 1/1 image change | no diff | no diff | no diff |
16 | DrawElements ( 8 VBO 8 UBO 8 Img) w/ 1/8 image change | no diff | no diff | no diff |
17 | DrawElements ( 8 VBO 8 UBO 8 Img) w/ 8/8 images change | 2.07739% +/- 0.63552% | no diff | 2.2928% +/- 0.622342% |
18 | DrawElements ( 8 VBO 8 UBO 1 ImB) w/ 1/1 image buffer change | no diff | no diff | no diff |
19 | DrawElements ( 8 VBO 8 UBO 8 ImB) w/ 1/8 image buffer change | no diff | no diff | no diff |
20 | DrawElements ( 8 VBO 8 UBO 8 ImB) w/ 8/8 image buffers change | no diff | no diff | 1.61882% +/- 1.08122% |
21 | DrawElements ( 8 VBO 1 UBO 8 Tex) w/ 1/1 UBO change | no diff | no diff | no diff |
22 | DrawElements ( 8 VBO 8 UBO 8 Tex) w/ 1/8 UBO change | 4.80623% +/- 1.0272% | no diff | 4.18786% +/- 1.13839% |
23 | DrawElements ( 8 VBO 8 UBO 8 Tex) w/ 8/8 UBOs change | 7.11535% +/- 1.04696% | no diff | 6.85476% +/- 1.02616% |
24 | DrawElements ( 8 VBO 8 UBO 8 Tex) w/ few uniforms / 1 change | no diff | -3.14764% +/- 2.52473% | no diff |
25 | DrawElements ( 8 VBO 8 UBO 8 Tex) w/ many uniforms / 1 change | no diff | no diff | 0.644216% +/- 0.496325% |
26 | DrawElements ( 8 VBO 8 UBO 8 Tex) w/ scissor change | no diff | no diff | no diff |
27 | DrawElements ( 8 VBO 8 UBO 8 Tex) w/ viewport change | no diff | no diff | no diff |
28 | DrawElements ( 8 VBO 8 UBO 8 Tex) w/ primitive restart enable change | no diff | no diff | no diff |
29 | DrawElements ( 8 VBO 8 UBO 8 Tex) w/ blend enable change | no diff | -1.77668% +/- 1.47833% | -1.59403% +/- 1.45681% |
30 | DrawElements ( 8 VBO 8 UBO 8 Tex) w/ depth enable change | no diff | no diff | no diff |
31 | DrawElements ( 8 VBO 8 UBO 8 Tex) w/ depth clamp enable change | no diff | no diff | no diff |
32 | DrawElements ( 8 VBO 8 UBO 8 Tex) w/ stencil enable change | no diff | no diff | no diff |
33 | DrawElements ( 8 VBO 8 UBO 8 Tex) w/ scissor enable change | no diff | no diff | no diff |
34 | DrawElements ( 8 VBO 8 UBO 8 Tex) w/ MSAA enable change | -2.42099% +/- 0.471341% | no diff | no diff |
35 | DrawElements ( 8 VBO 8 UBO 8 Tex) w/ sample mask enable change | no diff | no diff | no diff |
36 | DrawElements ( 8 VBO 8 UBO 8 Tex) w/ alpha-to-coverage enable change | no diff | no diff | no diff |
37 | DrawElements ( 8 VBO 8 UBO 8 Tex) w/ sample shading enable change | no diff | no diff | no diff |
38 | DrawElements ( 8 VBO 8 UBO 8 Tex) w/ cull face enable change | 3.39663% +/- 2.3016% | 1.25779% +/- 1.06235% | 2.05928% +/- 1.05797% |
39 | DrawElements ( 8 VBO 8 UBO 8 Tex) w/ clip distance enable change | no diff | no diff | no diff |