Commit eba9936b authored by Tvrtko Ursulin's avatar Tvrtko Ursulin

gem_wsim: Rip out userspace balancing

Evaluation of userspace load balancing options was how this tool started
but since we have settled on doing it in the kernel.

Tomorrow we will want to update the tool for new engine interfaces and all
this legacy code will just be a distraction.

Rip out everything not related to explicit load balancing implemented via
context engine maps and adjust the workloads to use it.
Signed-off-by: Tvrtko Ursulin's avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
Acked-by: Chris Wilson's avatarChris Wilson <chris@chris-wilson.co.uk>
parent eba1135d
......@@ -25,4 +25,4 @@ gem_latency_CFLAGS = $(AM_CFLAGS) $(THREAD_CFLAGS)
gem_latency_LDADD = $(LDADD) -lpthread
gem_syslatency_CFLAGS = $(AM_CFLAGS) $(THREAD_CFLAGS)
gem_syslatency_LDADD = $(LDADD) -lpthread
gem_wsim_LDADD = $(LDADD) $(top_builddir)/lib/libigt_perf.la -lpthread
gem_wsim_LDADD = $(LDADD) -lpthread
......@@ -19,12 +19,6 @@ benchmarks_prog_list = \
vgem_mmap \
$(NULL)
gem_wsim_SOURCES = \
gem_wsim.c \
ewma.h \
ilog2.h \
$(NULL)
LIBDRM_INTEL_BENCHMARKS = \
intel_upload_blit_large \
intel_upload_blit_large_gtt \
......
#ifndef EWMA_H
#define EWMA_H
#include <ilog2.h>
#define BUILD_BUG_ON(expr)
#define BUILD_BUG_ON_NOT_POWER_OF_2(expr)
/*
* Exponentially weighted moving average (EWMA)
*
* This implements a fixed-precision EWMA algorithm, with both the
* precision and fall-off coefficient determined at compile-time
* and built into the generated helper funtions.
*
* The first argument to the macro is the name that will be used
* for the struct and helper functions.
*
* The second argument, the precision, expresses how many bits are
* used for the fractional part of the fixed-precision values.
*
* The third argument, the weight reciprocal, determines how the
* new values will be weighed vs. the old state, new values will
* get weight 1/weight_rcp and old values 1-1/weight_rcp. Note
* that this parameter must be a power of two for efficiency.
*/
#define DECLARE_EWMA(T, name, _precision, _weight_rcp) \
struct ewma_##name { \
T internal; \
}; \
static inline void ewma_##name##_init(struct ewma_##name *e) \
{ \
BUILD_BUG_ON(!__builtin_constant_p(_precision)); \
BUILD_BUG_ON(!__builtin_constant_p(_weight_rcp)); \
/* \
* Even if you want to feed it just 0/1 you should have \
* some bits for the non-fractional part... \
*/ \
BUILD_BUG_ON((_precision) > 30); \
BUILD_BUG_ON_NOT_POWER_OF_2(_weight_rcp); \
e->internal = 0; \
} \
static inline T \
ewma_##name##_read(struct ewma_##name *e) \
{ \
BUILD_BUG_ON(!__builtin_constant_p(_precision)); \
BUILD_BUG_ON(!__builtin_constant_p(_weight_rcp)); \
BUILD_BUG_ON((_precision) > 30); \
BUILD_BUG_ON_NOT_POWER_OF_2(_weight_rcp); \
return e->internal >> (_precision); \
} \
static inline void ewma_##name##_add(struct ewma_##name *e, \
T val) \
{ \
const T weight_rcp = ilog2(_weight_rcp); \
const T precision = _precision; \
T internal = e->internal; \
\
BUILD_BUG_ON(!__builtin_constant_p(_precision)); \
BUILD_BUG_ON(!__builtin_constant_p(_weight_rcp)); \
BUILD_BUG_ON((_precision) > 30); \
BUILD_BUG_ON_NOT_POWER_OF_2(_weight_rcp); \
\
e->internal = internal ? \
(((internal << weight_rcp) - internal) + \
(val << precision)) >> weight_rcp : \
(val << precision); \
}
#endif /* EWMA_H */
This diff is collapsed.
#ifndef ILOG2_H
#define ILOG2_H
#include <stdint.h>
static inline int fls(int x)
{
int r = -1;
asm("bsrl %1,%0" : "=r" (r) : "rm" (x), "0" (-1));
return r + 1;
}
static inline int fls64(__u64 x)
{
int r = -1;
asm("bsrq %1,%q0" : "+r" (r) : "rm" (x));
return r + 1;
}
static inline __attribute__((const))
int __ilog2_u32(uint32_t n)
{
return fls(n) - 1;
}
static inline __attribute__((const))
int __ilog2_u64(uint64_t n)
{
return fls64(n) - 1;
}
#define ilog2(n) \
( \
__builtin_constant_p(n) ? ( \
(n) < 2 ? 0 : \
(n) & (1ULL << 63) ? 63 : \
(n) & (1ULL << 62) ? 62 : \
(n) & (1ULL << 61) ? 61 : \
(n) & (1ULL << 60) ? 60 : \
(n) & (1ULL << 59) ? 59 : \
(n) & (1ULL << 58) ? 58 : \
(n) & (1ULL << 57) ? 57 : \
(n) & (1ULL << 56) ? 56 : \
(n) & (1ULL << 55) ? 55 : \
(n) & (1ULL << 54) ? 54 : \
(n) & (1ULL << 53) ? 53 : \
(n) & (1ULL << 52) ? 52 : \
(n) & (1ULL << 51) ? 51 : \
(n) & (1ULL << 50) ? 50 : \
(n) & (1ULL << 49) ? 49 : \
(n) & (1ULL << 48) ? 48 : \
(n) & (1ULL << 47) ? 47 : \
(n) & (1ULL << 46) ? 46 : \
(n) & (1ULL << 45) ? 45 : \
(n) & (1ULL << 44) ? 44 : \
(n) & (1ULL << 43) ? 43 : \
(n) & (1ULL << 42) ? 42 : \
(n) & (1ULL << 41) ? 41 : \
(n) & (1ULL << 40) ? 40 : \
(n) & (1ULL << 39) ? 39 : \
(n) & (1ULL << 38) ? 38 : \
(n) & (1ULL << 37) ? 37 : \
(n) & (1ULL << 36) ? 36 : \
(n) & (1ULL << 35) ? 35 : \
(n) & (1ULL << 34) ? 34 : \
(n) & (1ULL << 33) ? 33 : \
(n) & (1ULL << 32) ? 32 : \
(n) & (1ULL << 31) ? 31 : \
(n) & (1ULL << 30) ? 30 : \
(n) & (1ULL << 29) ? 29 : \
(n) & (1ULL << 28) ? 28 : \
(n) & (1ULL << 27) ? 27 : \
(n) & (1ULL << 26) ? 26 : \
(n) & (1ULL << 25) ? 25 : \
(n) & (1ULL << 24) ? 24 : \
(n) & (1ULL << 23) ? 23 : \
(n) & (1ULL << 22) ? 22 : \
(n) & (1ULL << 21) ? 21 : \
(n) & (1ULL << 20) ? 20 : \
(n) & (1ULL << 19) ? 19 : \
(n) & (1ULL << 18) ? 18 : \
(n) & (1ULL << 17) ? 17 : \
(n) & (1ULL << 16) ? 16 : \
(n) & (1ULL << 15) ? 15 : \
(n) & (1ULL << 14) ? 14 : \
(n) & (1ULL << 13) ? 13 : \
(n) & (1ULL << 12) ? 12 : \
(n) & (1ULL << 11) ? 11 : \
(n) & (1ULL << 10) ? 10 : \
(n) & (1ULL << 9) ? 9 : \
(n) & (1ULL << 8) ? 8 : \
(n) & (1ULL << 7) ? 7 : \
(n) & (1ULL << 6) ? 6 : \
(n) & (1ULL << 5) ? 5 : \
(n) & (1ULL << 4) ? 4 : \
(n) & (1ULL << 3) ? 3 : \
(n) & (1ULL << 2) ? 2 : \
1 ) : \
(sizeof(n) <= 4) ? \
__ilog2_u32(n) : \
__ilog2_u64(n) \
)
#endif /* ILOG2_H */
......@@ -11,6 +11,7 @@ benchmark_progs = [
'gem_prw',
'gem_set_domain',
'gem_syslatency',
'gem_wsim',
'kms_vblank',
'prime_lookup',
'vgem_mmap',
......@@ -34,8 +35,3 @@ foreach prog : benchmark_progs
install_dir : benchmarksdir,
dependencies : igt_deps)
endforeach
executable('gem_wsim', 'gem_wsim.c',
install : true,
install_dir : benchmarksdir,
dependencies : igt_deps + [ lib_igt_perf ])
M.1.VCS
B.1
1.VCS.5000-10000.0.0
2.RCS.1000-2000.-1.0
P.3.1
......
1.VCS.12000-15000.0.0
M.10.VCS
B.10
M.11.VCS
B.11
M.12.VCS
B.12
10.VCS.12000-15000.0.0
2.RCS.1000-2200.-1.0
3.RCS.1000-1400.-1.0
3.RCS.10000-12000.0.0
3.VCS.2500-3500.-1.0
11.VCS.2500-3500.-1.0
4.RCS.1000-2200.-5.0
5.RCS.1000-1400.-1.0
5.RCS.10000-12000.0.0
5.VCS.2500-3500.-1.1
12.VCS.2500-3500.-1.1
1.VCS.12000-15000.0.0
M.10.VCS
B.10
10.VCS.12000-15000.0.0
2.RCS.1000-2200.-1.0
3.RCS.1000-1400.-1.0
3.RCS.10000-12000.0.0
3.VCS.2500-3500.-1.0
11.VCS.2500-3500.-1.0
4.RCS.400-800.-5.0
5.RCS.500-700.-1.0
5.RCS.5000-6000.0.0
5.VCS.1200-1500.-1.1
12.VCS.1200-1500.-1.1
1.VCS.12000-15000.0.0
M.10.VCS
B.10
M.11.VCS
B.11
M.12.VCS
B.12
M.13.VCS
B.13
10.VCS.12000-15000.0.0
2.RCS.1000-2200.-1.0
3.RCS.1000-1400.-1.0
3.RCS.10000-12000.0.0
3.VCS.2500-3500.-1.0
11.VCS.2500-3500.-1.0
4.RCS.1000-2200.-5.0
5.RCS.1000-1400.-1.0
5.RCS.10000-12000.0.0
5.VCS.2500-3500.-1.0
12.VCS.2500-3500.-1.0
6.RCS.1000-2200.-9.0
7.RCS.1000-1400.-1.0
7.RCS.10000-12000.0.0
7.VCS.2500-3500.-1.1
13.VCS.2500-3500.-1.1
M.10.VCS
B.10
M.11.VCS
B.11
M.12.VCS
B.12
M.13.VCS
B.13
1.VCS.12000-15000.0.0
2.RCS.1000-2200.-1.0
3.RCS.1000-1400.-1.0
......
1.VCS.12000-15000.0.0
M.10.VCS
B.10
M.11.VCS
B.11
M.12.VCS
B.12
M.13.VCS
B.13
M.14.VCS
B.14
10.VCS.12000-15000.0.0
2.RCS.1000-2200.-1.0
3.RCS.1000-1400.-1.0
3.RCS.10000-12000.0.0
3.VCS.2500-3500.-1.0
11.VCS.2500-3500.-1.0
4.RCS.1000-2200.-5.0
5.RCS.1000-1400.-1.0
5.RCS.10000-12000.0.0
5.VCS.2500-3500.-1.0
12.VCS.2500-3500.-1.0
6.RCS.1000-2200.-9.0
7.RCS.1000-1400.-1.0
7.RCS.10000-12000.0.0
7.VCS.2500-3500.-1.0
13.VCS.2500-3500.-1.0
8.RCS.1000-2200.-13.0
9.RCS.1000-1400.-1.0
9.RCS.10000-12000.0.0
9.VCS.2500-3500.-1.1
14.VCS.2500-3500.-1.1
M.10.VCS
B.10
M.11.VCS
B.11
M.12.VCS
B.12
M.13.VCS
B.13
M.14.VCS
B.14
1.VCS.12000-15000.0.0
2.RCS.1000-2200.-1.0
3.RCS.1000-1400.-1.0
......
1.VCS.12000-15000.0.0
M.10.VCS
B.10
M.11.VCS
B.11
M.12.VCS
B.12
M.13.VCS
B.13
M.14.VCS
B.14
M.15.VCS
B.15
10.VCS.12000-15000.0.0
2.RCS.1000-2200.-1.0
3.RCS.1000-1400.-1.0
3.RCS.10000-12000.0.0
3.VCS.2500-3500.-1.0
11.VCS.2500-3500.-1.0
4.RCS.1000-2200.-5.0
5.RCS.1000-1400.-1.0
5.RCS.10000-12000.0.0
5.VCS.2500-3500.-1.0
12.VCS.2500-3500.-1.0
6.RCS.1000-2200.-9.0
7.RCS.1000-1400.-1.0
7.RCS.10000-12000.0.0
7.VCS.2500-3500.-1.0
13.VCS.2500-3500.-1.0
8.RCS.1000-2200.-13.0
9.RCS.1000-1400.-1.0
9.RCS.10000-12000.0.0
9.VCS.2500-3500.-1.0
14.VCS.2500-3500.-1.0
10.RCS.1000-2200.-17.0
11.RCS.1000-1400.-1.0
11.RCS.10000-12000.0.0
11.VCS.2500-3500.-1.1
15.VCS.2500-3500.-1.1
M.10.VCS
B.10
M.11.VCS
B.11
M.12.VCS
B.12
M.13.VCS
B.13
M.14.VCS
B.14
M.15.VCS
B.15
1.VCS.12000-15000.0.0
2.RCS.2000-3000.-1.0
3.RCS.500-900.-1.0
......
M.1.VCS
B.1
1.VCS.2800-3200.0.1
1.RCS.900-1100.-1.0
1.RCS.3600-3800.0.0
1.RCS.900-1100.-2.0
2.RCS.900-1100.-1.0
2.RCS.3600-3800.0.0
2.RCS.900-1100.-2.0
1.VCS.2200-2400.-2.0
1.RCS.4500-4900.-1.0
2.RCS.4500-4900.-1.0
1.VCS.500-700.-1.1
M.1.VCS
B.1
0.VECS.1400-1500.0.0
0.RCS.1000-1500.-1.0
s.-2
......@@ -5,6 +7,6 @@ s.-2
1.VCS.1300-1400.0.1
0.VECS.1400-1500.0.0
0.RCS.100-300.-1.1
1.RCS.1300-1500.0.0
2.RCS.1300-1500.-3.0
1.VCS.100-300.-1.1
1.VCS.900-1400.0.1
M.1.VCS
B.1
1.VCS.4000-6000.0.0
2.RCS.400-800.-1.0
3.RCS.1900-2200.-1.0
......
M.3.VCS
B.3
1.VCS1.1200-1800.0.0
1.VCS1.1900-2100.0.0
2.RCS.1500-2000.-1.0
2.VCS.1400-1800.-1.1
3.VCS.1400-1800.-1.1
1.VCS1.1900-2100.-1.0
2.RCS.1500-2000.-1.0
2.VCS.1400-1800.-1.1
3.VCS.1400-1800.-1.1
1.VCS1.1900-2100.-1.0
2.RCS.200-400.-1.0
2.RCS.1500-2000.0.0
2.VCS.1400-1800.-1.1
3.VCS.1400-1800.-1.1
1.VCS1.1900-2100.-1.0
2.RCS.1500-2000.-1.0
2.VCS.1400-1800.-1.1
3.VCS.1400-1800.-1.1
1.VCS1.1900-2100.-1.0
2.RCS.200-400.-1.0
2.RCS.1500-2000.0.0
2.VCS.1400-1800.-1.1
3.VCS.1400-1800.-1.1
1.VCS1.1900-2100.-1.0
2.RCS.1500-2000.-1.0
2.VCS.1400-1800.-1.1
3.VCS.1400-1800.-1.1
1.VCS1.1900-2100.-1.0
2.RCS.1500-2000.-1.0
2.RCS.1500-2000.0.0
2.VCS.1400-1800.-1.1
3.VCS.1400-1800.-1.1
M.1.VCS
B.1
M.3.VCS
B.3
1.VCS.1400-1900.0.0
1.RCS.1200-1600.-1.0
1.RCS.1000-1400.-1.0
2.VCS.800-1000.-1.0
2.RCS.1200-1600.-1.0
2.RCS.1000-1400.-1.0
3.VCS.800-1000.-1.0
1.VCS.1400-1900.-4.0
1.RCS.1200-1600.-1.0
1.RCS.1000-1400.-1.0
2.VCS.800-1000.-1.0
2.RCS.1200-1600.-1.0
2.RCS.1000-1400.-1.0
3.VCS.800-1000.-1.0
1.VCS.1400-1900.-4.0
1.RCS.1200-1600.-1.0
1.RCS.1000-1400.-1.0
2.VCS.800-1000.-1.0
2.RCS.1200-1600.-1.0
2.RCS.1000-1400.-1.0
3.VCS.800-1000.-1.0
1.VCS.1400-1900.-4.0
1.RCS.1200-1600.-1.0
1.RCS.1000-1400.-1.0
2.VCS.800-1000.-1.0
2.RCS.1200-1600.-1.0
2.RCS.1000-1400.-1.0
3.VCS.800-1000.-1.0
1.VCS.1400-1900.-4.0
1.RCS.1200-1600.-1.0
1.RCS.1000-1400.-1.0
2.VCS.800-1000.-1.0
2.RCS.1200-1600.-1.0
2.RCS.1000-1400.-1.0
3.VCS.800-1000.-1.0
s.-17
s.-14
s.-11
......
M.1.VCS
B.1
M.4.VCS
B.4
1.VCS.900-1700.0.0
2.RCS.100-400.-1.0
3.RCS.800-900.-1.0
3.VCS.100-200.-1.1
4.VCS.100-200.-1.1
M.1.VCS
B.1
M.4.VCS
B.4
1.VCS.850-1300.0.0
2.RCS.50-250.-1.0
3.RCS.400-800.-1.0
3.VCS.100-200.-1.1
4.VCS.100-200.-1.1
M.1.VCS
B.1
M.3.VCS
B.3
1.VCS.900-1400.0.0
2.RCS.200-300.-1.0
2.RCS.1000-2000.0.0
2.RCS.1000-2000.0.0
2.VCS.800-1000.-1.0
1.RCS.2800-3100.-1.0
3.VCS.800-1000.-1.0
4.RCS.2800-3100.-1.0
1.VCS.800-1000.-1.1
M.1.VCS
B.1
M.4.VCS
B.4
M.7.VCS
B.7
M.8.VCS
B.8
1.VCS.12000-15000.0.0
2.RCS.1000-2200.-1.0
3.RCS.800-1600.-1.0
......@@ -5,5 +13,5 @@
5.RCS.1000-2200.-1.0
6.RCS.800-1600.-1.0
6.RCS.10000-12000.-4.0
6.VCS.2500-3500.-1.0
3.VCS.2500-3500.-2.1
7.VCS.2500-3500.-1.0
8.VCS.2500-3500.-2.1
M.1.VCS
B.1
M.4.VCS
B.4
M.7.VCS
B.7
M.10.VCS
B.10
M.11.VCS
B.11
M.12.VCS
B.12
1.VCS.12000-15000.0.0
2.RCS.1000-2200.-1.0
3.RCS.800-1600.-1.0
......@@ -8,6 +20,6 @@
8.RCS.1000-2200.-1.0
9.RCS.800-1600.-1.0
9.RCS.10000-12000.-7/-4.0
9.VCS.2500-3500.-1.0
3.VCS.2500-3500.-2.0
6.VCS.2500-3500.-3.1
10.VCS.2500-3500.-1.0
11.VCS.2500-3500.-2.0
12.VCS.2500-3500.-3.1
M.1.VCS
B.1
M.4.VCS
B.4
M.7.VCS
B.7
M.10.VCS
B.10
M.13.VCS
B.13
M.14.VCS
B.14
M.15.VCS
B.15
M.16.VCS
B.16
1.VCS.12000-15000.0.0
2.RCS.1000-2200.-1.0
3.RCS.800-1600.-1.0
......@@ -11,7 +27,7 @@
11.RCS.1000-2200.-1.0
12.RCS.800-1600.-1.0
12.RCS.10000-12000.-4/-7/-10.0
12.VCS.2500-3500.-1.0
3.VCS.2500-3500.-2.0
6.VCS.2500-3500.-3.0
9.VCS.2500-3500.-4.1
13.VCS.2500-3500.-1.0
14.VCS.2500-3500.-2.0
15.VCS.2500-3500.-3.0
16.VCS.2500-3500.-4.1
M.1.VCS
B.1
M.3.VCS
B.3
1.VCS.13000-17000.0.0
2.RCS.2000-4000.-1.0
3.RCS.3000-5000.-1.0
......
M.4.VCS
B.4
f
1.VCS1.6500-8000.f-1.0
1.VCS2.6500-8000.f-2.0
......@@ -5,4 +7,4 @@ a.-3
2.RCS.2000-4000.-2/-3.0
3.RCS.3000-5000.-1.0
3.RCS.23000-27000.0.0
3.VCS.16000-20000.-1.1
4.VCS.16000-20000.-1.1
M.1.VCS
B.1
1.VCS.13000-17000.0.0
2.RCS.2000-4000.-1.0
3.RCS.3000-5000.-1.0
......
M.1.VCS
B.1
1.VCS.13000-17000.0.0
2.RCS.2000-4000.-1.0
3.RCS.3000-5000.-1.0
......
M.1.VCS
B.1
M.3.VCS
B.3
1.VCS.12000-15000.0.0
2.RCS.1000-2200.-1.0