Skip to contentSkip to conversation

drm/i915/evict: watch out for unevictable nodes

PATCH In review Matthew Auld 3 participants 4 messages Apr 8, 2020

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

PATCH 1/1 drm/i915/evict: watch out for unevictable nodes

In an address space there can be sprinkling of I915_COLOR_UNEVICTABLE nodes, which lack a parent vma. For platforms with cache coloring we might be very unlucky and abut with such a node thinking we can simply unbind the vma.

---
 drivers/gpu/drm/i915/i915_gem_evict.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpu/drm/i915/i915_gem_evict.c +4 -0
index 4518b9b35c3d..9e462c6a4c6a 100644
@@ -227,6 +227,10 @@ i915_gem_evict_something(struct i915_address_space *vm,
 	}
 
 	while (ret == 0 && (node = drm_mm_scan_color_evict(&scan))) {
+		/* If we find any non-objects (!vma), we cannot evict them */
+		if (node->color == I915_COLOR_UNEVICTABLE)
+			return -ENOSPC;
+
 		vma = container_of(node, struct i915_vma, node);
 		ret = __i915_vma_unbind(vma);
 	}
Signature · 6 lines
2.20.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

[Intel-gfx] ✗ Fi.CI.BAT: failure for drm/i915/evict: watch out for unevictable nodes

== Series Details ==

== Series Details ==

Series: drm/i915/evict: watch out for unevictable nodes
URL : https://patchwork.freedesktop.org/series/75691/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_8278 -> Patchwork_17258
====================================================

Summary
-------

**FAILURE**

Serious unknown changes coming with Patchwork_17258 absolutely need to be verified manually.

If you think the reported changes have nothing to do with the changes introduced in Patchwork_17258, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.

External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17258/index.html

Possible new issues
-------------------

Here are the unknown changes that may have been introduced in Patchwork_17258:

### IGT changes ###

#### Possible regressions ####

* igt@i915_selftest@live@execlists:
- fi-icl-y: [PASS][1] -> [INCOMPLETE][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8278/fi-icl-y/igt@i915_selftest@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17258/fi-icl-y/igt@i915_selftest@[email protected]

Known issues
------------

Here are the changes found in Patchwork_17258 that come from known issues:

### IGT changes ###

#### Warnings ####

* igt@i915_pm_rpm@module-reload:
- fi-kbl-x1275: [FAIL][3] ([i915#62]) -> [SKIP][4] ([fdo#109271])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8278/fi-kbl-x1275/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17258/fi-kbl-x1275/igt@[email protected]

[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[i915#62]: https://gitlab.freedesktop.org/drm/intel/issues/62

Participating hosts (53 -> 47)
------------------------------

Missing (6): fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-byt-clapper fi-bdw-samus

Build changes
-------------

* CI: CI-20190529 -> None
* Linux: CI_DRM_8278 -> Patchwork_17258

CI-20190529: 20190529
CI_DRM_8278: 6c961d30815647db306abce9e8129c9253abc33e @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5581: ab0620e555119ec55f12ba9ab9e6e9246d407648 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_17258: ef1b0db5ef6bddcf1849e714854352346d0c6e91 @ git://anongit.freedesktop.org/gfx-ci/linux

== Linux commits ==

ef1b0db5ef6b drm/i915/evict: watch out for unevictable nodes

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17258/index.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#2 lore raw
In reply to Matthew Auld

Quoting Matthew Auld (2020-04-08 18:04:56)

Quoted 4 lines

In an address space there can be sprinkling of I915_COLOR_UNEVICTABLE nodes, which lack a parent vma. For platforms with cache coloring we might be very unlucky and abut with such a node thinking we can simply unbind the vma.

I did notice this myself recently (from observation); it's highly unlikely to ever matter.

Quoted 10 lines
---
 drivers/gpu/drm/i915/i915_gem_evict.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpu/drm/i915/i915_gem_evict.c +0 -0
index 4518b9b35c3d..9e462c6a4c6a 100644

drivers/gpu/drm/i915/i915_gem_evict.c i915_gem_evict_something(struct i915_address_space *vm, · line 232

Quoted 6 lines
drivers/gpu/drm/i915/i915_gem_evict.c +3 -0
@@ -227,6 +227,10 @@ i915_gem_evict_something(struct i915_address_space *vm,
        }
 
        while (ret == 0 && (node = drm_mm_scan_color_evict(&scan))) {
+               /* If we find any non-objects (!vma), we cannot evict them */
+               if (node->color == I915_COLOR_UNEVICTABLE)
+                       return -ENOSPC;

Returning error immediately looks ok, I was worried as around here we usually have lists to clean up, but this is after those. However, I would suggest that setting ret = -ENOSPC would be more consistent with the flow.

Fwiw, we can actually pull this logic into evict_for_node for a bit of simplification.
-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#3 lore raw

Quoting Chris Wilson (2020-04-08 20:44:43)

Quoted 21 lines

Quoting Matthew Auld (2020-04-08 18:04:56)

Quoted 4 lines

In an address space there can be sprinkling of I915_COLOR_UNEVICTABLE nodes, which lack a parent vma. For platforms with cache coloring we might be very unlucky and abut with such a node thinking we can simply unbind the vma.

I did notice this myself recently (from observation); it's highly unlikely to ever matter.

Quoted 12 lines
---
 drivers/gpu/drm/i915/i915_gem_evict.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpu/drm/i915/i915_gem_evict.c +0 -0
index 4518b9b35c3d..9e462c6a4c6a 100644
@@ -227,6 +227,10 @@ i915_gem_evict_something(struct i915_address_space *vm,
        }
 
Quoted 9 lines

drivers/gpu/drm/i915/i915_gem_evict.c i915_gem_evict_something(struct i915_address_space *vm, · line 232

Quoted 4 lines
drivers/gpu/drm/i915/i915_gem_evict.c +3 -0
        while (ret == 0 && (node = drm_mm_scan_color_evict(&scan))) {
+               /* If we find any non-objects (!vma), we cannot evict them */
+               if (node->color == I915_COLOR_UNEVICTABLE)
+                       return -ENOSPC;

Returning error immediately looks ok, I was worried as around here we usually have lists to clean up, but this is after those. However, I would suggest that setting ret = -ENOSPC would be more consistent with the flow.

Actually, while this prevents an explosion [good], it now returns an unexpected error [bad]. No explosion is the lesser evil. -Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx