public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Ashutosh Dixit <ashutosh.dixit@intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t] igt/gem_shrink: touch each page in pwrite_/pread_
Date: Fri,  8 May 2020 15:05:41 -0700	[thread overview]
Message-ID: <20200508220541.1796-1-ashutosh.dixit@intel.com> (raw)

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>
---
 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

             reply	other threads:[~2020-05-08 22:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-08 22:05 Ashutosh Dixit [this message]
2020-05-08 22:08 ` [igt-dev] [PATCH i-g-t] igt/gem_shrink: touch each page in pwrite_/pread_ Chris Wilson
2020-05-08 22:30 ` [igt-dev] ✓ Fi.CI.BAT: success for igt/gem_shrink: touch each page in pwrite_/pread_ (rev3) Patchwork
2020-05-09  0:40 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2020-05-08 21:34 [igt-dev] [PATCH i-g-t] igt/gem_shrink: touch each page in pwrite_/pread_ Ashutosh Dixit
2020-05-08 21:41 ` Chris Wilson
2020-05-08 21:29 Ashutosh Dixit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200508220541.1796-1-ashutosh.dixit@intel.com \
    --to=ashutosh.dixit@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox