intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [Intel-gfx] [PATCH 1/2] drm/i915/selftests: fixup igt_shrink_thp
@ 2021-07-29 13:34 Tvrtko Ursulin
  2021-07-29 13:34 ` [Intel-gfx] [PATCH 2/2] drm/i915: Use Transparent Hugepages when IOMMU is enabled Tvrtko Ursulin
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Tvrtko Ursulin @ 2021-07-29 13:34 UTC (permalink / raw)
  To: Intel-gfx; +Cc: Matthew Auld, dri-devel

From: Matthew Auld <matthew.auld@intel.com>

Since the object might still be active here, the shrink_all will simply
ignore it, which blows up in the test, since the pages will still be
there. Currently THP is disabled which should result in the test being
skipped, but if we ever re-enable THP we might start seeing the failure.
Fix this by forcing I915_SHRINK_ACTIVE.

Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 drivers/gpu/drm/i915/gem/selftests/huge_pages.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/gem/selftests/huge_pages.c b/drivers/gpu/drm/i915/gem/selftests/huge_pages.c
index a094f3ce1a90..acc435f14ac9 100644
--- a/drivers/gpu/drm/i915/gem/selftests/huge_pages.c
+++ b/drivers/gpu/drm/i915/gem/selftests/huge_pages.c
@@ -1572,12 +1572,15 @@ static int igt_shrink_thp(void *arg)
 		goto out_put;
 
 	/*
-	 * Now that the pages are *unpinned* shrink-all should invoke
+	 * Now that the pages are *unpinned* shrinking should invoke
 	 * shmem to truncate our pages.
 	 */
-	i915_gem_shrink_all(i915);
+	i915_gem_shrink(NULL, i915, -1UL, NULL,
+			I915_SHRINK_BOUND |
+			I915_SHRINK_UNBOUND |
+			I915_SHRINK_ACTIVE);
 	if (i915_gem_object_has_pages(obj)) {
-		pr_err("shrink-all didn't truncate the pages\n");
+		pr_err("shrinking didn't truncate the pages\n");
 		err = -EINVAL;
 		goto out_put;
 	}
-- 
2.30.2

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 10+ messages in thread
* [Intel-gfx] [PATCH 1/2] drm/i915/selftests: fixup igt_shrink_thp
@ 2021-07-29 11:18 Tvrtko Ursulin
  2021-07-29 11:48 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/2] " Patchwork
  0 siblings, 1 reply; 10+ messages in thread
From: Tvrtko Ursulin @ 2021-07-29 11:18 UTC (permalink / raw)
  To: Intel-gfx; +Cc: Matthew Auld, dri-devel

From: Matthew Auld <matthew.auld@intel.com>

Since the object might still be active here, the shrink_all will simply
ignore it, which blows up in the test, since the pages will still be
there. Currently THP is disabled which should result in the test being
skipped, but if we ever re-enable THP we might start seeing the failure.
Fix this by forcing I915_SHRINK_ACTIVE.

Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 drivers/gpu/drm/i915/gem/selftests/huge_pages.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/gem/selftests/huge_pages.c b/drivers/gpu/drm/i915/gem/selftests/huge_pages.c
index a094f3ce1a90..acc435f14ac9 100644
--- a/drivers/gpu/drm/i915/gem/selftests/huge_pages.c
+++ b/drivers/gpu/drm/i915/gem/selftests/huge_pages.c
@@ -1572,12 +1572,15 @@ static int igt_shrink_thp(void *arg)
 		goto out_put;
 
 	/*
-	 * Now that the pages are *unpinned* shrink-all should invoke
+	 * Now that the pages are *unpinned* shrinking should invoke
 	 * shmem to truncate our pages.
 	 */
-	i915_gem_shrink_all(i915);
+	i915_gem_shrink(NULL, i915, -1UL, NULL,
+			I915_SHRINK_BOUND |
+			I915_SHRINK_UNBOUND |
+			I915_SHRINK_ACTIVE);
 	if (i915_gem_object_has_pages(obj)) {
-		pr_err("shrink-all didn't truncate the pages\n");
+		pr_err("shrinking didn't truncate the pages\n");
 		err = -EINVAL;
 		goto out_put;
 	}
-- 
2.30.2

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2021-09-07  9:34 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-29 13:34 [Intel-gfx] [PATCH 1/2] drm/i915/selftests: fixup igt_shrink_thp Tvrtko Ursulin
2021-07-29 13:34 ` [Intel-gfx] [PATCH 2/2] drm/i915: Use Transparent Hugepages when IOMMU is enabled Tvrtko Ursulin
2021-07-29 14:06   ` Daniel Vetter
2021-09-03 12:47     ` Tvrtko Ursulin
2021-09-07  8:42       ` Daniel Vetter
2021-09-07  9:34         ` Tvrtko Ursulin
2021-07-29 14:01 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/2] drm/i915/selftests: fixup igt_shrink_thp Patchwork
2021-07-29 14:29 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2021-07-29 23:16 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2021-07-29 11:18 [Intel-gfx] [PATCH 1/2] " Tvrtko Ursulin
2021-07-29 11:48 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/2] " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).