diff options
author | Ashutosh Dixit <ashutosh.dixit@intel.com> | 2020-05-08 15:05:41 -0700 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2020-05-09 09:24:57 +0100 |
commit | 9d0576c821f886fd053effd96cd3c441fee2ce53 (patch) | |
tree | f5e4d06378cf34902ec41ddc2b888d0358d39380 /tests/i915/gem_shrink.c | |
parent | d1ce4abb01c70f7be6e777b6d45442663c4b830e (diff) |
igt/gem_shrink: touch each page in pwrite_/pread_
pwrite_() and pread_() purport to read each page but weren't.
v2: Keep subpage iteration (Chris)
Reported-by: CQ Tang <cq.tang@intel.com>
Fixes: 88bfe6ac41 ("igt/gem_shrink: Add pread/pwrite stress)
Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tests/i915/gem_shrink.c')
-rw-r--r-- | tests/i915/gem_shrink.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/i915/gem_shrink.c b/tests/i915/gem_shrink.c index c9964ccc..10d63942 100644 --- a/tests/i915/gem_shrink.c +++ b/tests/i915/gem_shrink.c @@ -58,7 +58,7 @@ static void pwrite_(int fd, uint64_t alloc) uint32_t tmp; uint32_t handle = gem_create(fd, alloc); for (int page = 0; page < alloc>>12; page++) - gem_write(fd, handle, (page + page % 4095) & ~3, &tmp, 4); + gem_write(fd, handle, ((page << 12) + page % 4095) & ~3, &tmp, 4); gem_madvise(fd, handle, I915_MADV_DONTNEED); } @@ -67,7 +67,7 @@ static void pread_(int fd, uint64_t alloc) uint32_t tmp; uint32_t handle = gem_create(fd, alloc); for (int page = 0; page < alloc>>12; page++) - gem_read(fd, handle, (page + page % 4095) & ~3, &tmp, 4); + gem_read(fd, handle, ((page << 12) + page % 4095) & ~3, &tmp, 4); gem_madvise(fd, handle, I915_MADV_DONTNEED); } |