Skip to contentSkip to conversation

drm/i915: Remove incorrect warning in context cleanup

PATCH Applied Tvrtko Ursulin 4 participants 9 messages Nov 20, 2015 – Nov 24, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/i915: Remove incorrect warning in context cleanup

From: Tvrtko Ursulin <[email protected]>

Commit e9f24d5fb7cf3628b195b18ff3ac4e37937ceeae

Author: Tvrtko Ursulin <[email protected]>
Date:   Mon Oct 5 13:26:36 2015 +0100

drm/i915: Clean up associated VMAs on context destruction

Added a warning based on an incorrect assumption that all VMAs in a VM will be on the inactive list at the point last reference to a context and VM is dropped.

This is not true because i915_gem_object_retire__read will not put VMA on the inactive list until all activities on the object in question (in all VMs) have been retired.

As a consequence, whether or not a context/VM will be destroyed with its VMAs still on the active list, can depend on completely unrelated activities using the same object from a different context or engine.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92638
Testcase: igt/gem_request_retire/retire-vma-not-inactive
Cc: Daniel Vetter <[email protected]>
Cc: Chris Wilson <[email protected]>
Cc: Michel Thierry <[email protected]>

---
 drivers/gpu/drm/i915/i915_gem_context.c | 2 --
 1 file changed, 2 deletions(-)
drivers/gpu/drm/i915/i915_gem_context.c +0 -2
index 204dc7c0b2d6..59dba318213e 100644
@@ -141,8 +141,6 @@ static void i915_gem_context_clean(struct intel_context *ctx)
 	if (!ppgtt)
 		return;
 
-	WARN_ON(!list_empty(&ppgtt->base.active_list));
-
 	list_for_each_entry_safe(vma, next, &ppgtt->base.inactive_list,
 				 mm_list) {
 		if (WARN_ON(__i915_vma_unbind_no_wait(vma)))
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw
Quoted 21 lines · Tvrtko Ursulin

From: Tvrtko Ursulin <[email protected]>

Commit e9f24d5fb7cf3628b195b18ff3ac4e37937ceeae

Author: Tvrtko Ursulin <[email protected]>
Date:   Mon Oct 5 13:26:36 2015 +0100

drm/i915: Clean up associated VMAs on context destruction

Added a warning based on an incorrect assumption that all VMAs in a VM will be on the inactive list at the point last reference to a context and VM is dropped.

This is not true because i915_gem_object_retire__read will not put VMA on the inactive list until all activities on the object in question (in all VMs) have been retired.

As a consequence, whether or not a context/VM will be destroyed with its VMAs still on the active list, can depend on completely unrelated activities using the same object from a different context or engine.

Quoted 6 lines

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92638
Testcase: igt/gem_request_retire/retire-vma-not-inactive
Cc: Daniel Vetter <[email protected]>
Cc: Chris Wilson <[email protected]>
Cc: Michel Thierry <[email protected]>

Queued for -next, thanks for the patch.
-Daniel

Quoted 20 lines
---
 drivers/gpu/drm/i915/i915_gem_context.c | 2 --
 1 file changed, 2 deletions(-)
drivers/gpu/drm/i915/i915_gem_context.c +0 -2
index 204dc7c0b2d6..59dba318213e 100644
@@ -141,8 +141,6 @@ static void i915_gem_context_clean(struct intel_context *ctx)
 	if (!ppgtt)
 		return;
 
-	WARN_ON(!list_empty(&ppgtt->base.active_list));
-
 	list_for_each_entry_safe(vma, next, &ppgtt->base.inactive_list,
 				 mm_list) {
 		if (WARN_ON(__i915_vma_unbind_no_wait(vma)))
Signature · 1 line
1.9.1
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#2 lore raw
Quoted 22 lines · Daniel Vetter
Quoted 21 lines · Tvrtko Ursulin

From: Tvrtko Ursulin <[email protected]>

Commit e9f24d5fb7cf3628b195b18ff3ac4e37937ceeae

Author: Tvrtko Ursulin <[email protected]>
Date:   Mon Oct 5 13:26:36 2015 +0100

drm/i915: Clean up associated VMAs on context destruction

Added a warning based on an incorrect assumption that all VMAs in a VM will be on the inactive list at the point last reference to a context and VM is dropped.

This is not true because i915_gem_object_retire__read will not put VMA on the inactive list until all activities on the object in question (in all VMs) have been retired.

As a consequence, whether or not a context/VM will be destroyed with its VMAs still on the active list, can depend on completely unrelated activities using the same object from a different context or engine.

Quoted 8 lines
Quoted 6 lines

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92638
Testcase: igt/gem_request_retire/retire-vma-not-inactive
Cc: Daniel Vetter <[email protected]>
Cc: Chris Wilson <[email protected]>
Cc: Michel Thierry <[email protected]>

Queued for -next, thanks for the patch.

The WARN_ON is accurate though. The original patch fails to fix even the limited aspect of the bug it claimed to.
-Chris

Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#3 lore raw
Quoted 30 lines · Chris Wilson
Quoted 29 lines · Daniel Vetter
Quoted 27 lines · Tvrtko Ursulin

From: Tvrtko Ursulin <[email protected]>

Commit e9f24d5fb7cf3628b195b18ff3ac4e37937ceeae

Author: Tvrtko Ursulin <[email protected]>
Date:   Mon Oct 5 13:26:36 2015 +0100

drm/i915: Clean up associated VMAs on context destruction

Added a warning based on an incorrect assumption that all VMAs in a VM will be on the inactive list at the point last reference to a context and VM is dropped.

This is not true because i915_gem_object_retire__read will not put VMA on the inactive list until all activities on the object in question (in all VMs) have been retired.

As a consequence, whether or not a context/VM will be destroyed with its VMAs still on the active list, can depend on completely unrelated activities using the same object from a different context or engine.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92638
Testcase: igt/gem_request_retire/retire-vma-not-inactive
Cc: Daniel Vetter <[email protected]>
Cc: Chris Wilson <[email protected]>
Cc: Michel Thierry <[email protected]>

Quoted 4 lines
Quoted 1 line

Queued for -next, thanks for the patch.

The WARN_ON is accurate though. The original patch fails to fix even the limited aspect of the bug it claimed to.

That is not true. It only makes it a bit more limited, and not by its fault even. Even with that it makes things a bit better, not worse.

And does not impede your VMA rewrite at all. For which I did offer help to review as you send out in manageable chunks.

If it is not realistically possible to split it out and do in increments, then it would be more constructive to discuss how to do it than to keep it in limbo for 15 months, as you say, and use it as a reason to shoot down everything else.

Regards,

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

#4 lore raw
Quoted 32 lines · Tvrtko Ursulin
Quoted 30 lines · Chris Wilson
Quoted 29 lines · Daniel Vetter
Quoted 27 lines · Tvrtko Ursulin

From: Tvrtko Ursulin <[email protected]>

Commit e9f24d5fb7cf3628b195b18ff3ac4e37937ceeae

Author: Tvrtko Ursulin <[email protected]>
Date:   Mon Oct 5 13:26:36 2015 +0100

drm/i915: Clean up associated VMAs on context destruction

Added a warning based on an incorrect assumption that all VMAs in a VM will be on the inactive list at the point last reference to a context and VM is dropped.

This is not true because i915_gem_object_retire__read will not put VMA on the inactive list until all activities on the object in question (in all VMs) have been retired.

As a consequence, whether or not a context/VM will be destroyed with its VMAs still on the active list, can depend on completely unrelated activities using the same object from a different context or engine.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92638
Testcase: igt/gem_request_retire/retire-vma-not-inactive
Cc: Daniel Vetter <[email protected]>
Cc: Chris Wilson <[email protected]>
Cc: Michel Thierry <[email protected]>

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

Queued for -next, thanks for the patch.

The WARN_ON is accurate though. The original patch fails to fix even the limited aspect of the bug it claimed to.

That is not true. It only makes it a bit more limited, and not by its fault even. Even with that it makes things a bit better, not worse.

It makes the code worse for very limited improvement, for which we did not have a publically reported bug, i.e. the impact is very small.

Quoted 2 lines

And does not impede your VMA rewrite at all. For which I did offer help to review as you send out in manageable chunks.

I have been.
-Chris

Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#5 lore raw

Hi,

Quoted 11 lines · Chris Wilson
Quoted 7 lines · Tvrtko Ursulin
Quoted 2 lines · Chris Wilson

The WARN_ON is accurate though. The original patch fails to fix even the limited aspect of the bug it claimed to.

That is not true. It only makes it a bit more limited, and not by its fault even. Even with that it makes things a bit better, not worse.

It makes the code worse for very limited improvement, for which we did not have a publically reported bug, i.e. the impact is very small.

I can get the person who reported it to me to raise a Bugzilla complaining about the WARN_ON if you like ...

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

#6 lore raw
Quoted 12 lines · Daniel Stone

Hi,

Quoted 9 lines · Chris Wilson
Quoted 7 lines · Tvrtko Ursulin
Quoted 2 lines · Chris Wilson

The WARN_ON is accurate though. The original patch fails to fix even the limited aspect of the bug it claimed to.

That is not true. It only makes it a bit more limited, and not by its fault even. Even with that it makes things a bit better, not worse.

Quoted 5 lines
Quoted 2 lines

It makes the code worse for very limited improvement, for which we did not have a publically reported bug, i.e. the impact is very small.

I can get the person who reported it to me to raise a Bugzilla complaining about the WARN_ON if you like ...

This is about the original bug, for with the bugfix resulted in the WARN_ON now being removed here. The underlying problem (I think, it's a maze) is that our vma active tracking is a bit ... underwhelming. -Daniel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#7 lore raw

Hey,

Quoted 14 lines · Daniel Vetter
Quoted 13 lines · Daniel Stone
Quoted 11 lines · Chris Wilson
Quoted 7 lines · Tvrtko Ursulin
Quoted 2 lines · Chris Wilson

The WARN_ON is accurate though. The original patch fails to fix even the limited aspect of the bug it claimed to.

That is not true. It only makes it a bit more limited, and not by its fault even. Even with that it makes things a bit better, not worse.

It makes the code worse for very limited improvement, for which we did not have a publically reported bug, i.e. the impact is very small.

Quoted 6 lines
Quoted 2 lines

I can get the person who reported it to me to raise a Bugzilla complaining about the WARN_ON if you like ...

This is about the original bug, for with the bugfix resulted in the WARN_ON now being removed here. The underlying problem (I think, it's a maze) is that our vma active tracking is a bit ... underwhelming.

Sure, which is fair enough, but OTOH is there an actual plan for redoing the VMA tracking?

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

#8 lore raw
In reply to Chris Wilson
Quoted 38 lines · Chris Wilson
Quoted 37 lines · Tvrtko Ursulin
Quoted 34 lines · Chris Wilson
Quoted 22 lines · Daniel Vetter
Quoted 21 lines · Tvrtko Ursulin

From: Tvrtko Ursulin <[email protected]>

Commit e9f24d5fb7cf3628b195b18ff3ac4e37937ceeae

Author: Tvrtko Ursulin <[email protected]>
Date:   Mon Oct 5 13:26:36 2015 +0100

drm/i915: Clean up associated VMAs on context destruction

Added a warning based on an incorrect assumption that all VMAs in a VM will be on the inactive list at the point last reference to a context and VM is dropped.

This is not true because i915_gem_object_retire__read will not put VMA on the inactive list until all activities on the object in question (in all VMs) have been retired.

As a consequence, whether or not a context/VM will be destroyed with its VMAs still on the active list, can depend on completely unrelated activities using the same object from a different context or engine.

Quoted 8 lines
Quoted 6 lines

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92638
Testcase: igt/gem_request_retire/retire-vma-not-inactive
Cc: Daniel Vetter <[email protected]>
Cc: Chris Wilson <[email protected]>
Cc: Michel Thierry <[email protected]>

Queued for -next, thanks for the patch.

The WARN_ON is accurate though. The original patch fails to fix even the limited aspect of the bug it claimed to.

Quoted 6 lines
Quoted 3 lines

That is not true. It only makes it a bit more limited, and not by its fault even. Even with that it makes things a bit better, not worse.

It makes the code worse for very limited improvement, for which we did not have a publically reported bug, i.e. the impact is very small.

Well impact was huge for Android userspace but you are probably right that BZ was not created for that.

It was somewhat related to https://bugs.freedesktop.org/show_bug.cgi?id=87477 on small memory configurations if I remember correctly. Although that hasn't been correctly captured in there or a new entry forked off.

We have on the other hand added an IGT for it gem_ppgtt/flink-and-close-vma-leak so I don't think your argument is fair.

Especially if the rewrite of it all is imminent - so the worse code, even if you think it is so much worse which I disagree with, is only in there temporary.

And the memory leak was real even with fbcon and Xorg which I am sure you know.

Quoted 4 lines
Quoted 2 lines

And does not impede your VMA rewrite at all. For which I did offer help to review as you send out in manageable chunks.

I have been.

And I have reviewed some, no? Feel free to ping me if I missed some.

Regards,

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