benchmarks/gem_exec_trace: Mark the mmap as sequentially read

Use madvise(MADV_SEQUENTIAL) to let the kernel optimise for our
straightforward sequential read pattern.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2015-08-10 18:45:00 +01:00
parent 3911621d0d
commit b483e68173

View File

@ -225,6 +225,11 @@ static void replay(const char *filename)
ptr = mmap(0, st.st_size, PROT_READ, MAP_SHARED, fd, 0);
close(fd);
if (ptr == MAP_FAILED)
return;
madvise(ptr, st.st_size, MADV_SEQUENTIAL);
end = ptr + st.st_size;
fd = drm_open_any();