diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2015-08-10 18:45:00 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2015-08-10 18:53:26 +0100 |
commit | b483e68173465408649e11122ee78060af9394f7 (patch) | |
tree | f6fafc022b1635a719203b4af2da3029869f6be9 /benchmarks/gem_exec_trace.c | |
parent | 3911621d0d23aced7feb1569b39f7fb52b309681 (diff) |
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>
Diffstat (limited to 'benchmarks/gem_exec_trace.c')
-rw-r--r-- | benchmarks/gem_exec_trace.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/benchmarks/gem_exec_trace.c b/benchmarks/gem_exec_trace.c index 598527ce..398fdaec 100644 --- a/benchmarks/gem_exec_trace.c +++ b/benchmarks/gem_exec_trace.c @@ -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(); |