igt/gem_exec_flush: Immediately repeat the same cacheline

When looking at a pair of GPU writes, where we want to make sure that
the clean cacheline is invalidated automatically, we want to reuse that
cacheline whilst we know it remains valid (i.e. repeat the test using a
new value to the same location).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2016-05-02 16:08:46 +01:00
parent cf07aa2fc6
commit 22e6157d38

View File

@ -151,17 +151,17 @@ static void run(int fd, unsigned ring, int nchild, int timeout,
munmap(ptr, 64*1024);
igt_timeout(timeout) {
bool xor = (cycles >> 10) & 1;
bool xor = false;
int idx = cycles++ % 1024;
/* Inspect a different cacheline each iteration */
i = 16 * (idx % 64) + (idx / 64);
obj[1].relocs_ptr = (uintptr_t)&reloc0[i];
obj[2].relocs_ptr = (uintptr_t)&reloc1[i];
execbuf.batch_start_offset = 64*i;
execbuf.buffer_count = 2 + xor;
overwrite:
execbuf.buffer_count = 2 + xor;
gem_execbuf(fd, &execbuf);
if (flags & SET_DOMAIN) {
@ -215,6 +215,11 @@ static void run(int fd, unsigned ring, int nchild, int timeout,
igt_clflush_range(&map[i], sizeof(map[i]));
}
}
if (!xor) {
xor= true;
goto overwrite;
}
}
igt_info("Child[%d]: %lu cycles\n", child, cycles);