Skip to contentSkip to conversation

drm/i915/selftests: Unwind hugepages to drop wakeref on error

PATCH In review Nirmoy Das 4 participants 6 messages Jan 13, 2023 – Jan 16, 2023

Subsystems (2)
lore
Share & tools
lore

Nirmoy Das

author
#0 lore raw

PATCH 1/1 drm/i915/selftests: Unwind hugepages to drop wakeref on error

From: Chris Wilson <[email protected]>

Make sure that upon error after we have acquired the wakeref we do release it again.

---
 drivers/gpu/drm/i915/gem/selftests/huge_pages.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/gem/selftests/huge_pages.c +3 -3
index c281b0ec9e05..295d6f2cc4ff 100644
@@ -1855,7 +1855,7 @@ static int igt_shrink_thp(void *arg)
 			I915_SHRINK_ACTIVE);
 	i915_vma_unpin(vma);
 	if (err)
-		goto out_put;
+		goto out_wf;
 
 	/*
 	 * Now that the pages are *unpinned* shrinking should invoke
@@ -1871,7 +1871,7 @@ static int igt_shrink_thp(void *arg)
 		pr_err("unexpected pages mismatch, should_swap=%s\n",
 		       str_yes_no(should_swap));
 		err = -EINVAL;
-		goto out_put;
+		goto out_wf;
 	}
 
 	if (should_swap == (obj->mm.page_sizes.sg || obj->mm.page_sizes.phys)) {
@@ -1883,7 +1883,7 @@ static int igt_shrink_thp(void *arg)
 
 	err = i915_vma_pin(vma, 0, 0, flags);
 	if (err)
-		goto out_put;
+		goto out_wf;
 
 	while (n--) {
 		err = cpu_check(obj, n, 0xdeadbeaf);
Signature · 1 line
2.39.0
#3 lore raw
Quoted 1 line · Nirmoy

Thanks Matt, I missed the Fixes tag so resent it with fixes and Cc to stable.

I don't think kernel selftests are really stable material. AFAIK it's not something normal users care about.

Quoted 11 lines · Matthew Auld
Quoted 9 lines · Nirmoy Das
Quoted 7 lines

From: Chris Wilson <[email protected]>

Make sure that upon error after we have acquired the wakeref we do release it again.

#4 lore raw
Quoted 4 lines · Matthew Auld
Quoted 1 line · Nirmoy

Thanks Matt, I missed the Fixes tag so resent it with fixes and Cc to stable.

I don't think kernel selftests are really stable material. AFAIK it's not something normal users care about.

True, in that case please ignore the latest copy of this patch!.

Thanks,

Nirmoy

Quoted 12 lines
Quoted 12 lines · Matthew Auld
Quoted 9 lines · Nirmoy Das
Quoted 7 lines

From: Chris Wilson <[email protected]>

Make sure that upon error after we have acquired the wakeref we do release it again.

Reviewed-by on v1 1/1
#5 lore raw
In reply to Nirmoy Das
Quoted 7 lines · Nirmoy Das

From: Chris Wilson <[email protected]>

Make sure that upon error after we have acquired the wakeref we do release it again.

Regards
Andrzej

Quoted 35 lines
---
  drivers/gpu/drm/i915/gem/selftests/huge_pages.c | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/gem/selftests/huge_pages.c +3 -3
index c281b0ec9e05..295d6f2cc4ff 100644
@@ -1855,7 +1855,7 @@ static int igt_shrink_thp(void *arg)
  			I915_SHRINK_ACTIVE);
  	i915_vma_unpin(vma);
  	if (err)
-		goto out_put;
+		goto out_wf;
 
  	/*
  	 * Now that the pages are *unpinned* shrinking should invoke
@@ -1871,7 +1871,7 @@ static int igt_shrink_thp(void *arg)
  		pr_err("unexpected pages mismatch, should_swap=%s\n",
  		       str_yes_no(should_swap));
  		err = -EINVAL;
-		goto out_put;
+		goto out_wf;
  	}
 
  	if (should_swap == (obj->mm.page_sizes.sg || obj->mm.page_sizes.phys)) {
@@ -1883,7 +1883,7 @@ static int igt_shrink_thp(void *arg)
 
  	err = i915_vma_pin(vma, 0, 0, flags);
  	if (err)
-		goto out_put;
+		goto out_wf;
 
  	while (n--) {
  		err = cpu_check(obj, n, 0xdeadbeaf);