Skip to contentSkip to conversation

drm/i915/buddy: avoid double list_add

PATCH New Matthew Auld 2 participants 4 messages Mar 5, 2020 – Mar 6, 2020

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

PATCH 1/2 drm/i915/buddy: avoid double list_add

Be careful not to mark an already free node as free again.

---
 drivers/gpu/drm/i915/i915_buddy.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_buddy.c +2 -1
index 66883af64ca1..20babbdb297d 100644
@@ -312,7 +312,8 @@ i915_buddy_alloc(struct i915_buddy_mm *mm, unsigned int order)
 	return block;
 
 out_free:
-	__i915_buddy_free(mm, block);
+	if (i != order)
+		__i915_buddy_free(mm, block);
 	return ERR_PTR(err);
 }
 
Signature · 6 lines
2.20.1

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

PATCH 2/2 drm/i915/selftests: try to rein in alloc_smoke

Depending on RNG we might try to fill an 8G region for every possible order, using the smallest possible chunk size of 4K, which seems to be very slow. Try to remedy the situation by adding an overall timeout for the test, while also selecting each order level in a random fashion.

---
 drivers/gpu/drm/i915/selftests/i915_buddy.c | 25 ++++++++++++++++-----
 1 file changed, 20 insertions(+), 5 deletions(-)
drivers/gpu/drm/i915/selftests/i915_buddy.c +20 -5
index 1b856bae67b5..939a6caebb03 100644
@@ -298,10 +298,12 @@ static void igt_mm_config(u64 *size, u64 *chunk_size)
 static int igt_buddy_alloc_smoke(void *arg)
 {
 	struct i915_buddy_mm mm;
-	int max_order;
+	IGT_TIMEOUT(end_time);
+	I915_RND_STATE(prng);
 	u64 chunk_size;
 	u64 mm_size;
-	int err;
+	int *order;
+	int err, i;
 
 	igt_mm_config(&mm_size, &chunk_size);
 
@@ -313,10 +315,16 @@ static int igt_buddy_alloc_smoke(void *arg)
 		return err;
 	}
 
-	for (max_order = mm.max_order; max_order >= 0; max_order--) {
+	order = i915_random_order(mm.max_order + 1, &prng);
+	if (!order)
+		goto out_fini;
+
+	for (i = 0; i <= mm.max_order; ++i) {
 		struct i915_buddy_block *block;
-		int order;
+		int max_order = order[i];
+		bool timeout = false;
 		LIST_HEAD(blocks);
+		int order;
 		u64 total;
 
 		err = igt_check_mm(&mm);
@@ -360,6 +368,11 @@ static int igt_buddy_alloc_smoke(void *arg)
 			}
 
 			total += i915_buddy_block_size(&mm, block);
+
+			if (__igt_timeout(end_time, NULL)) {
+				timeout = true;
+				break;
+			}
 		} while (total < mm.size);
 
 		if (!err)
@@ -373,7 +386,7 @@ static int igt_buddy_alloc_smoke(void *arg)
 				pr_err("post-mm check failed\n");
 		}
 
-		if (err)
+		if (err || timeout)
 			break;
 
 		cond_resched();
@@ -382,6 +395,8 @@ static int igt_buddy_alloc_smoke(void *arg)
 	if (err == -ENOMEM)
 		err = 0;
 
+	kfree(order);
+out_fini:
 	i915_buddy_fini(&mm);
 
 	return err;
Signature · 6 lines
2.20.1

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

[Intel-gfx] ✗ Fi.CI.DOCS: warning for series starting with [1/2] drm/i915/buddy: avoid double list_add

In reply to Matthew Auld
== Series Details ==

== Series Details ==

Series: series starting with [1/2] drm/i915/buddy: avoid double list_add
URL : https://patchwork.freedesktop.org/series/74355/
State : warning

== Summary ==

$ make htmldocs 2>&1 > /dev/null | grep i915
./drivers/gpu/drm/i915/display/intel_dpll_mgr.h:285: warning: Function parameter or member 'get_freq' not described in 'intel_shared_dpll_funcs'

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

#3 lore raw

[Intel-gfx] ✗ Fi.CI.BAT: failure for series starting with [1/2] drm/i915/buddy: avoid double list_add

In reply to Matthew Auld
== Series Details ==

== Series Details ==

Series: series starting with [1/2] drm/i915/buddy: avoid double list_add
URL : https://patchwork.freedesktop.org/series/74355/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_8074 -> Patchwork_16850
====================================================

Summary
-------

**FAILURE**

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

If you think the reported changes have nothing to do with the changes introduced in Patchwork_16850, 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_16850/index.html

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

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

### IGT changes ###

#### Possible regressions ####

* igt@i915_selftest@live@gem:
- fi-bsw-kefka: [PASS][1] -> [INCOMPLETE][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8074/fi-bsw-kefka/igt@i915_selftest@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16850/fi-bsw-kefka/igt@i915_selftest@[email protected]

#### Warnings ####

* igt@amdgpu/amd_prime@amd-to-i915:
- fi-icl-y: [SKIP][3] ([fdo#109315]) -> [SKIP][4] +1 similar issue
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8074/fi-icl-y/igt@amdgpu/[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16850/fi-icl-y/igt@amdgpu/[email protected]

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

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

### IGT changes ###

#### Issues hit ####

* igt@gem_exec_suspend@basic-s3:
- fi-skl-6600u: [PASS][5] -> [INCOMPLETE][6] ([i915#69])
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8074/fi-skl-6600u/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16850/fi-skl-6600u/igt@[email protected]

* igt@gem_render_linear_blits@basic:
- fi-tgl-y: [PASS][7] -> [DMESG-WARN][8] ([CI#94] / [i915#402]) +1 similar issue
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8074/fi-tgl-y/igt@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16850/fi-tgl-y/igt@[email protected]

* igt@i915_selftest@live@execlists:
- fi-icl-y: [PASS][9] -> [INCOMPLETE][10] ([i915#140])
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8074/fi-icl-y/igt@i915_selftest@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16850/fi-icl-y/igt@i915_selftest@[email protected]

* igt@i915_selftest@live@gem_contexts:
- fi-cml-s: [PASS][11] -> [DMESG-FAIL][12] ([i915#877])
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8074/fi-cml-s/igt@i915_selftest@live@gem_contexts.html
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16850/fi-cml-s/igt@i915_selftest@live@gem_contexts.html

#### Possible fixes ####

* igt@prime_vgem@basic-gtt:
- fi-tgl-y: [DMESG-WARN][13] ([CI#94] / [i915#402]) -> [PASS][14] +1 similar issue
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8074/fi-tgl-y/igt@[email protected]
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16850/fi-tgl-y/igt@[email protected]

[CI#94]: https://gitlab.freedesktop.org/gfx-ci/i915-infra/issues/94
[fdo#109315]: https://bugs.freedesktop.org/show_bug.cgi?id=109315
[i915#140]: https://gitlab.freedesktop.org/drm/intel/issues/140
[i915#402]: https://gitlab.freedesktop.org/drm/intel/issues/402
[i915#69]: https://gitlab.freedesktop.org/drm/intel/issues/69
[i915#877]: https://gitlab.freedesktop.org/drm/intel/issues/877

Participating hosts (50 -> 43)
------------------------------

Additional (1): fi-kbl-7560u
Missing (8): fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-ctg-p8600 fi-ivb-3770 fi-skl-lmem fi-byt-clapper fi-bdw-samus

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

* CI: CI-20190529 -> None
* Linux: CI_DRM_8074 -> Patchwork_16850

CI-20190529: 20190529
CI_DRM_8074: 0dd63259839ca847514d9999749219635f311015 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5495: 22df72de8affcec22d9f354bb6148d77f60cc580 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_16850: 362c612df08473f377fa496f1767bcaf4d186c58 @ git://anongit.freedesktop.org/gfx-ci/linux

== Linux commits ==

362c612df084 drm/i915/selftests: try to rein in alloc_smoke e89ba2d291ff drm/i915/buddy: avoid double list_add

== Logs ==

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