From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by gabe.freedesktop.org (Postfix) with ESMTPS id E0B1B6E2A0 for ; Fri, 8 May 2020 22:05:47 +0000 (UTC) From: Ashutosh Dixit Date: Fri, 8 May 2020 15:05:41 -0700 Message-Id: <20200508220541.1796-1-ashutosh.dixit@intel.com> MIME-Version: 1.0 Subject: [igt-dev] [PATCH i-g-t] igt/gem_shrink: touch each page in pwrite_/pread_ List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" To: igt-dev@lists.freedesktop.org List-ID: pwrite_() and pread_() purport to read each page but weren't. v2: Keep subpage iteration (Chris) Reported-by: CQ Tang Fixes: 88bfe6ac41 ("igt/gem_shrink: Add pread/pwrite stress) Signed-off-by: Ashutosh Dixit --- tests/i915/gem_shrink.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/i915/gem_shrink.c b/tests/i915/gem_shrink.c index c9964ccc0..10d639423 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); } -- 2.26.0 _______________________________________________ igt-dev mailing list igt-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/igt-dev