Skip to contentSkip to conversation

igt/gem_partial_pwrite_pread: Add set-cache subtest to validate JIRA VIZ-3721

PATCH In review [email protected] 3 participants 7 messages Jun 12, 2014 – Jul 12, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 igt/gem_partial_pwrite_pread: Add set-cache subtest to validate JIRA VIZ-3721

From: Armin Reese <[email protected]>

This subtest forces the driver down the code path in i915_gem_object_set_cache_level() which unbinds VMAs and triggers the kernel panic described in VIZ-3721. This test will pass if the bug fix is in place.

Bugzilla: https://bugs.fredesktop.org/show_bug.cgi?id=76384

---
 tests/gem_partial_pwrite_pread.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
tests/gem_partial_pwrite_pread.c +11 -0
index 7945ba7..3e3ecc9 100644
@@ -131,6 +131,14 @@ static void test_partial_reads(void)
 
 }
 
+static void test_set_cache(void)
+{
+	igt_info("checking set-cache\n");
+
+	blt_bo_fill(staging_bo, scratch_bo, 0);
+
+}
+
 static void test_partial_writes(void)
 {
 	int i, j;
@@ -244,6 +252,9 @@ static void do_tests(int cache_level, const char *suffix)
 			gem_set_caching(fd, scratch_bo->handle, cache_level);
 	}
 
+	igt_subtest_f("set-cache%s", suffix)
+		test_set_cache();
+
 	igt_subtest_f("reads%s", suffix)
 		test_partial_reads();
 
Signature · 1 line
1.9.1
#1 lore raw
Quoted 7 lines · On Thu, Jun 12, 2014 at 02:18:37PM -0700, [email protected] wrote:

From: Armin Reese <[email protected]>

This subtest forces the driver down the code path in i915_gem_object_set_cache_level() which unbinds VMAs and triggers the kernel panic described in VIZ-3721. This test will pass if the bug fix is in place.

Bugzilla: https://bugs.fredesktop.org/show_bug.cgi?id=76384

Where's that?
-Chris

Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre
#2 lore raw
In reply to [email protected]
Quoted 17 lines · On Thu, Jun 12, 2014 at 02:18:37PM -0700, [email protected] wrote:

From: Armin Reese <[email protected]>

This subtest forces the driver down the code path in i915_gem_object_set_cache_level() which unbinds VMAs and triggers the kernel panic described in VIZ-3721. This test will pass if the bug fix is in place.

Bugzilla: https://bugs.fredesktop.org/show_bug.cgi?id=76384

---
 tests/gem_partial_pwrite_pread.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
tests/gem_partial_pwrite_pread.c +0 -0
index 7945ba7..3e3ecc9 100644

tests/gem_partial_pwrite_pread.c static void test_partial_reads(void) · line 140

Quoted 10 lines
tests/gem_partial_pwrite_pread.c +7 -0
@@ -131,6 +131,14 @@ static void test_partial_reads(void)
 
 }
 
+static void test_set_cache(void)
+{
+	igt_info("checking set-cache\n");
+
+	blt_bo_fill(staging_bo, scratch_bo, 0);
+
+}

Ok, my apologies for the unclear JIRA description. My idea was to have a tailor-made testcase with a minimal reproduction scenario (i.e. map into 2 ppgtt or ggtt + ppgtt, then do a set_caching ioctl).

This here blows up because we do the set_caching as part of the fixture, so has a high risk that when someone decides to refactor the testcase we'll no longer test this bug. Hence the task to create a new, specific testcase.
-Daniel

Quoted 21 lines
tests/gem_partial_pwrite_pread.c +4 -0
+
 static void test_partial_writes(void)
 {
 	int i, j;
@@ -244,6 +252,9 @@ static void do_tests(int cache_level, const char *suffix)
 			gem_set_caching(fd, scratch_bo->handle, cache_level);
 	}
 
+	igt_subtest_f("set-cache%s", suffix)
+		test_set_cache();
+
 	igt_subtest_f("reads%s", suffix)
 		test_partial_reads();
 
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
#3 lore raw

Which of the I-G-Ts would be the best to house the set-cache subtest? Is gem_partial_pwrite_pread a good candidate?
- Armin

-----Original Message-----
From: Daniel Vetter [mailto:[email protected]] On Behalf Of Daniel Vetter
Sent: Friday, June 13, 2014 12:14 AM
To: Reese, Armin C
Cc: [email protected]
Subject: Re: [Intel-gfx] [PATCH] igt/gem_partial_pwrite_pread: Add set-cache subtest to validate JIRA VIZ-3721

Quoted 18 lines · On Thu, Jun 12, 2014 at 02:18:37PM -0700, [email protected] wrote:

From: Armin Reese <[email protected]>

This subtest forces the driver down the code path in i915_gem_object_set_cache_level() which unbinds VMAs and triggers the kernel panic described in VIZ-3721. This test will pass if the bug fix is in place.

Bugzilla: https://bugs.fredesktop.org/show_bug.cgi?id=76384

---
 tests/gem_partial_pwrite_pread.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
tests/gem_partial_pwrite_pread.c +0 -0
index 7945ba7..3e3ecc9 100644

tests/gem_partial_pwrite_pread.c static void test_partial_reads(void) · line 140

Quoted 10 lines
tests/gem_partial_pwrite_pread.c +7 -0
@@ -131,6 +131,14 @@ static void test_partial_reads(void)
 
 }
 
+static void test_set_cache(void)
+{
+	igt_info("checking set-cache\n");
+
+	blt_bo_fill(staging_bo, scratch_bo, 0);
+
+}

Ok, my apologies for the unclear JIRA description. My idea was to have a tailor-made testcase with a minimal reproduction scenario (i.e. map into 2 ppgtt or ggtt + ppgtt, then do a set_caching ioctl).

This here blows up because we do the set_caching as part of the fixture, so has a high risk that when someone decides to refactor the testcase we'll no longer test this bug. Hence the task to create a new, specific testcase. -Daniel

Quoted 16 lines
tests/gem_partial_pwrite_pread.c +4 -1
+
 static void test_partial_writes(void)  {
 	int i, j;
@@ -244,6 +252,9 @@ static void do_tests(int cache_level, const char *suffix)
 			gem_set_caching(fd, scratch_bo->handle, cache_level);
 	}
 
+	igt_subtest_f("set-cache%s", suffix)
+		test_set_cache();
+
 	igt_subtest_f("reads%s", suffix)
 		test_partial_reads();
 
--

1.9.1

Quoted 4 lines

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

#4 lore raw
Quoted 2 lines · Armin C

Which of the I-G-Ts would be the best to house the set-cache subtest? Is gem_partial_pwrite_pread a good candidate?

I guess you could just create a new test binary if there's nothing suitable. Especially for tests I'm leaning towards "code reuse is overrated". And with igt_simple_main there's really no boilerplate (besides the obligatory license header) left.
-Daniel

Quoted 69 lines

- Armin

-----Original Message-----
From: Daniel Vetter [mailto:[email protected]] On Behalf Of Daniel Vetter
Sent: Friday, June 13, 2014 12:14 AM
To: Reese, Armin C
Cc: [email protected]
Subject: Re: [Intel-gfx] [PATCH] igt/gem_partial_pwrite_pread: Add set-cache subtest to validate JIRA VIZ-3721

Quoted 18 lines · On Thu, Jun 12, 2014 at 02:18:37PM -0700, [email protected] wrote:

From: Armin Reese <[email protected]>

This subtest forces the driver down the code path in i915_gem_object_set_cache_level() which unbinds VMAs and triggers the kernel panic described in VIZ-3721. This test will pass if the bug fix is in place.

Bugzilla: https://bugs.fredesktop.org/show_bug.cgi?id=76384

---
 tests/gem_partial_pwrite_pread.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
tests/gem_partial_pwrite_pread.c +0 -0
index 7945ba7..3e3ecc9 100644

tests/gem_partial_pwrite_pread.c static void test_partial_reads(void) · line 140

Quoted 10 lines
tests/gem_partial_pwrite_pread.c +7 -0
@@ -131,6 +131,14 @@ static void test_partial_reads(void)
 
 }
 
+static void test_set_cache(void)
+{
+	igt_info("checking set-cache\n");
+
+	blt_bo_fill(staging_bo, scratch_bo, 0);
+
+}

Ok, my apologies for the unclear JIRA description. My idea was to have a tailor-made testcase with a minimal reproduction scenario (i.e. map into 2 ppgtt or ggtt + ppgtt, then do a set_caching ioctl).

This here blows up because we do the set_caching as part of the fixture, so has a high risk that when someone decides to refactor the testcase we'll no longer test this bug. Hence the task to create a new, specific testcase. -Daniel

Quoted 16 lines
tests/gem_partial_pwrite_pread.c +4 -1
+
 static void test_partial_writes(void)  {
 	int i, j;
@@ -244,6 +252,9 @@ static void do_tests(int cache_level, const char *suffix)
 			gem_set_caching(fd, scratch_bo->handle, cache_level);
 	}
 
+	igt_subtest_f("set-cache%s", suffix)
+		test_set_cache();
+
 	igt_subtest_f("reads%s", suffix)
 		test_partial_reads();
 
--

1.9.1

Quoted 4 lines

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
#5 lore raw
In reply to [email protected]

Hi Daniel,

Is it possible to get this patch on the review board? I've been on vacation a couple of weeks and haven't been around to push it.

Thanks,
Armin

-----Original Message-----
From: Reese, Armin C
Sent: Thursday, June 12, 2014 2:19 PM
To: [email protected]
Cc: Reese, Armin C
Subject: [PATCH] igt/gem_partial_pwrite_pread: Add set-cache subtest to validate JIRA VIZ-3721

From: Armin Reese <[email protected]>

This subtest forces the driver down the code path in i915_gem_object_set_cache_level() which unbinds VMAs and triggers the kernel panic described in VIZ-3721. This test will pass if the bug fix is in place.

Bugzilla: https://bugs.fredesktop.org/show_bug.cgi?id=76384

---
 tests/gem_partial_pwrite_pread.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
tests/gem_partial_pwrite_pread.c +11 -0
index 7945ba7..3e3ecc9 100644
@@ -131,6 +131,14 @@ static void test_partial_reads(void)
 
 }
 
+static void test_set_cache(void)
+{
+	igt_info("checking set-cache\n");
+
+	blt_bo_fill(staging_bo, scratch_bo, 0);
+
+}
+
 static void test_partial_writes(void)
 {
 	int i, j;
@@ -244,6 +252,9 @@ static void do_tests(int cache_level, const char *suffix)
 			gem_set_caching(fd, scratch_bo->handle, cache_level);
 	}
 
+	igt_subtest_f("set-cache%s", suffix)
+		test_set_cache();
+
 	igt_subtest_f("reads%s", suffix)
 		test_partial_reads();
 

--
1.9.1

#6 lore raw
Quoted 4 lines · Armin C

Hi Daniel,

Is it possible to get this patch on the review board? I've been on vacation a couple of weeks and haven't been around to push it.

Already done the review in my other reply ... Have you missed it?

http://www.spinics.net/lists/intel-gfx/msg47146.html

-Daniel

Quoted 57 lines

Thanks,
Armin

-----Original Message-----
From: Reese, Armin C
Sent: Thursday, June 12, 2014 2:19 PM
To: [email protected]
Cc: Reese, Armin C
Subject: [PATCH] igt/gem_partial_pwrite_pread: Add set-cache subtest to validate JIRA VIZ-3721

From: Armin Reese <[email protected]>

This subtest forces the driver down the code path in i915_gem_object_set_cache_level() which unbinds VMAs and triggers the kernel panic described in VIZ-3721. This test will pass if the bug fix is in place.

Bugzilla: https://bugs.fredesktop.org/show_bug.cgi?id=76384

---
 tests/gem_partial_pwrite_pread.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
tests/gem_partial_pwrite_pread.c +11 -1
index 7945ba7..3e3ecc9 100644
@@ -131,6 +131,14 @@ static void test_partial_reads(void)
 
 }
 
+static void test_set_cache(void)
+{
+	igt_info("checking set-cache\n");
+
+	blt_bo_fill(staging_bo, scratch_bo, 0);
+
+}
+
 static void test_partial_writes(void)
 {
 	int i, j;
@@ -244,6 +252,9 @@ static void do_tests(int cache_level, const char *suffix)
 			gem_set_caching(fd, scratch_bo->handle, cache_level);
 	}
 
+	igt_subtest_f("set-cache%s", suffix)
+		test_set_cache();
+
 	igt_subtest_f("reads%s", suffix)
 		test_partial_reads();
 
--

1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch