Skip to contentSkip to conversation

drm/mm: add ig_frag selftest

RFC PATCH Superseded Nirmoy Das 6 participants 13 messages May 29, 2020 – Jun 3, 2020

Subsystems (2)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Nirmoy Das

author
#0 lore raw

RFC PATCH 1/1 drm/mm: add ig_frag selftest

This patch introduces fragmentation in the address range and measures time taken by 10k and 20k insertions. ig_frag() will fail if time taken by 20k insertions takes more than 4 times of 10k insertions as we know that insertions scale quadratically. Also tolerate 10% error because of kernel scheduler's jitters.

Output:
<snip>

[ 8092.653518] drm_mm: Testing DRM range manger (struct drm_mm), with random_seed=0x9bfb4117 max_iterations=8192 max_prime=128
[ 8092.653520] drm_mm: igt_sanitycheck - ok!
[ 8092.653525] igt_debug 0x0000000000000000-0x0000000000000200: 512: free
[ 8092.653526] igt_debug 0x0000000000000200-0x0000000000000600: 1024: used
[ 8092.653527] igt_debug 0x0000000000000600-0x0000000000000a00: 1024: free
[ 8092.653528] igt_debug 0x0000000000000a00-0x0000000000000e00: 1024: used
[ 8092.653529] igt_debug 0x0000000000000e00-0x0000000000001000: 512: free
[ 8092.653529] igt_debug total: 4096, used 2048 free 2048
[ 8112.569813] drm_mm: best fragmented insert of 10000 and 20000 insertions took 504 and 1996 msecs
[ 8112.723254] drm_mm: bottom-up fragmented insert of 10000 and 20000 insertions took 44 and 108 msecs
[ 8112.813212] drm_mm: top-down fragmented insert of 10000 and 20000 insertions took 40 and 44 msecs
[ 8112.847733] drm_mm: evict fragmented insert of 10000 and 20000 insertions took 8 and 20 msecs

<snip>

---
 drivers/gpu/drm/selftests/drm_mm_selftests.h |  1 +
 drivers/gpu/drm/selftests/test-drm_mm.c      | 73 ++++++++++++++++++++
 2 files changed, 74 insertions(+)
drivers/gpu/drm/selftests/drm_mm_selftests.h +1 -0
index 6b943ea1c57d..8c87c964176b 100644
@@ -14,6 +14,7 @@ selftest(insert, igt_insert)
 selftest(replace, igt_replace)
 selftest(insert_range, igt_insert_range)
 selftest(align, igt_align)
+selftest(frag, igt_frag)
 selftest(align32, igt_align32)
 selftest(align64, igt_align64)
 selftest(evict, igt_evict)
drivers/gpu/drm/selftests/test-drm_mm.c +73 -0

79 lines not on this page · raw message

Signature · 6 lines
2.26.2

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

This works correctly most of the times but sometimes

20k insertions can take more than 8 times of 10k insertion time.

Regards,

Nirmoy

Quoted 114 lines · Nirmoy Das

This patch introduces fragmentation in the address range and measures time taken by 10k and 20k insertions. ig_frag() will fail if time taken by 20k insertions takes more than 4 times of 10k insertions as we know that insertions scale quadratically. Also tolerate 10% error because of kernel scheduler's jitters.

Output:
<snip>

[ 8092.653518] drm_mm: Testing DRM range manger (struct drm_mm), with random_seed=0x9bfb4117 max_iterations=8192 max_prime=128
[ 8092.653520] drm_mm: igt_sanitycheck - ok!
[ 8092.653525] igt_debug 0x0000000000000000-0x0000000000000200: 512: free
[ 8092.653526] igt_debug 0x0000000000000200-0x0000000000000600: 1024: used
[ 8092.653527] igt_debug 0x0000000000000600-0x0000000000000a00: 1024: free
[ 8092.653528] igt_debug 0x0000000000000a00-0x0000000000000e00: 1024: used
[ 8092.653529] igt_debug 0x0000000000000e00-0x0000000000001000: 512: free
[ 8092.653529] igt_debug total: 4096, used 2048 free 2048
[ 8112.569813] drm_mm: best fragmented insert of 10000 and 20000 insertions took 504 and 1996 msecs
[ 8112.723254] drm_mm: bottom-up fragmented insert of 10000 and 20000 insertions took 44 and 108 msecs
[ 8112.813212] drm_mm: top-down fragmented insert of 10000 and 20000 insertions took 40 and 44 msecs
[ 8112.847733] drm_mm: evict fragmented insert of 10000 and 20000 insertions took 8 and 20 msecs

<snip>

---
  drivers/gpu/drm/selftests/drm_mm_selftests.h |  1 +
  drivers/gpu/drm/selftests/test-drm_mm.c      | 73 ++++++++++++++++++++
  2 files changed, 74 insertions(+)
drivers/gpu/drm/selftests/drm_mm_selftests.h +1 -0
index 6b943ea1c57d..8c87c964176b 100644
@@ -14,6 +14,7 @@ selftest(insert, igt_insert)
  selftest(replace, igt_replace)
  selftest(insert_range, igt_insert_range)
  selftest(align, igt_align)
+selftest(frag, igt_frag)
  selftest(align32, igt_align32)
  selftest(align64, igt_align64)
  selftest(evict, igt_evict)
drivers/gpu/drm/selftests/test-drm_mm.c +66 -0
index 9aabe82dcd3a..05d8f3659b4d 100644
@@ -1033,6 +1033,79 @@ static int igt_insert_range(void *ignored)
  	return 0;
  }
 
+static int get_insert_time(unsigned int num_insert,
+			   const struct insert_mode *mode)
+{
+	struct drm_mm mm;
+	struct drm_mm_node *nodes, *node, *next;
+	unsigned int size = 4096, align = 8192;
+	unsigned long start;
+	unsigned int i;
+	int ret = -EINVAL;
+
+	drm_mm_init(&mm, 1, U64_MAX - 2);
+	nodes = vzalloc(array_size(num_insert, sizeof(*nodes)));
+	if (!nodes)
+		goto err;
+
+	start = jiffies;
+	for (i = 0; i < num_insert; i++) {
+		if (!expect_insert(&mm, &nodes[i], size, align, i, mode)) {
+			pr_err("%s insert failed\n", mode->name);
+			goto out;
+		}
+	}
+
+	ret = jiffies_to_msecs(jiffies - start);
+out:
+	drm_mm_for_each_node_safe(node, next, &mm)
+		drm_mm_remove_node(node);
+	drm_mm_takedown(&mm);
+	vfree(nodes);
+err:
+	return ret;
+
+}
+
+static int igt_frag(void *ignored)
+{
+	const struct insert_mode *mode;
+	unsigned int insert_time1, insert_time2;
+	unsigned int insert_size = 10000;
+	unsigned int scale_factor = 4;
+	/* tolerate 10% excess insertion duration */
+	unsigned int error_factor = 110;
+	int ret = -EINVAL;
+
+	for (mode = insert_modes; mode->name; mode++) {
+		unsigned int expected_time;
+
+		insert_time1 = get_insert_time(insert_size, mode);
+		if (insert_time1 < 0)
+			goto err;
+
+		insert_time2 = get_insert_time((insert_size * 2), mode);
+		if (insert_time2 < 0)
+			goto err;
+
+		expected_time = (scale_factor * insert_time1 *
+				 error_factor)/100;
+		if (insert_time2 > expected_time) {
+			pr_err("%s fragmented insert took more %u msecs\n",
+			       mode->name, insert_time2 - expected_time);
+			goto err;
+		}
+
+		pr_info("%s fragmented insert of %u and %u insertions took %u and %u msecs\n",
+			mode->name, insert_size, insert_size * 2, insert_time1,
+			insert_time2);

drivers/gpu/drm/selftests/test-drm_mm.c static int igt_insert_range(void *ignored) · line 1111

Quoted 10 lines
drivers/gpu/drm/selftests/test-drm_mm.c +7 -0
+	}
+
+	ret = 0;
+err:
+	return ret;
+}
+
  static int igt_align(void *ignored)
  {
  	const struct insert_mode *mode;

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#2 lore raw

Quoting Nirmoy (2020-05-29 16:40:53)

Quoted 3 lines

This works correctly most of the times but sometimes

20k insertions can take more than 8 times of 10k insertion time.

The pressure is on to improve then :)

Quoted 53 lines

Regards,

Nirmoy

Quoted 48 lines · Nirmoy Das

This patch introduces fragmentation in the address range and measures time taken by 10k and 20k insertions. ig_frag() will fail if time taken by 20k insertions takes more than 4 times of 10k insertions as we know that insertions scale quadratically. Also tolerate 10% error because of kernel scheduler's jitters.

Output:
<snip>

[ 8092.653518] drm_mm: Testing DRM range manger (struct drm_mm), with random_seed=0x9bfb4117 max_iterations=8192 max_prime=128
[ 8092.653520] drm_mm: igt_sanitycheck - ok!
[ 8092.653525] igt_debug 0x0000000000000000-0x0000000000000200: 512: free
[ 8092.653526] igt_debug 0x0000000000000200-0x0000000000000600: 1024: used
[ 8092.653527] igt_debug 0x0000000000000600-0x0000000000000a00: 1024: free
[ 8092.653528] igt_debug 0x0000000000000a00-0x0000000000000e00: 1024: used
[ 8092.653529] igt_debug 0x0000000000000e00-0x0000000000001000: 512: free
[ 8092.653529] igt_debug total: 4096, used 2048 free 2048
[ 8112.569813] drm_mm: best fragmented insert of 10000 and 20000 insertions took 504 and 1996 msecs
[ 8112.723254] drm_mm: bottom-up fragmented insert of 10000 and 20000 insertions took 44 and 108 msecs
[ 8112.813212] drm_mm: top-down fragmented insert of 10000 and 20000 insertions took 40 and 44 msecs
[ 8112.847733] drm_mm: evict fragmented insert of 10000 and 20000 insertions took 8 and 20 msecs

<snip>

---
  drivers/gpu/drm/selftests/drm_mm_selftests.h |  1 +
  drivers/gpu/drm/selftests/test-drm_mm.c      | 73 ++++++++++++++++++++
  2 files changed, 74 insertions(+)
drivers/gpu/drm/selftests/drm_mm_selftests.h +1 -0
index 6b943ea1c57d..8c87c964176b 100644
@@ -14,6 +14,7 @@ selftest(insert, igt_insert)
  selftest(replace, igt_replace)
  selftest(insert_range, igt_insert_range)
  selftest(align, igt_align)
+selftest(frag, igt_frag)
  selftest(align32, igt_align32)
  selftest(align64, igt_align64)
  selftest(evict, igt_evict)
drivers/gpu/drm/selftests/test-drm_mm.c +0 -0
index 9aabe82dcd3a..05d8f3659b4d 100644
@@ -1033,6 +1033,79 @@ static int igt_insert_range(void *ignored)
      return 0;
  }
 
Quoted 16 lines
Quoted 6 lines
drivers/gpu/drm/selftests/test-drm_mm.c +6 -0
+static int get_insert_time(unsigned int num_insert,
+                        const struct insert_mode *mode)
+{
+     struct drm_mm mm;
+     struct drm_mm_node *nodes, *node, *next;
+     unsigned int size = 4096, align = 8192;

drivers/gpu/drm/selftests/test-drm_mm.c static int igt_insert_range(void *ignored) · line 1051

Quoted 10 lines
drivers/gpu/drm/selftests/test-drm_mm.c +10 -0
+     unsigned long start;
+     unsigned int i;
+     int ret = -EINVAL;
+
+     drm_mm_init(&mm, 1, U64_MAX - 2);
+     nodes = vzalloc(array_size(num_insert, sizeof(*nodes)));
+     if (!nodes)
+             goto err;
+
+     start = jiffies;

Use ktime_t start = ktime_now();

Quoted 8 lines

drivers/gpu/drm/selftests/test-drm_mm.c static int igt_insert_range(void *ignored) · line 1059

Quoted 8 lines
drivers/gpu/drm/selftests/test-drm_mm.c +8 -0
+     for (i = 0; i < num_insert; i++) {
+             if (!expect_insert(&mm, &nodes[i], size, align, i, mode)) {
+                     pr_err("%s insert failed\n", mode->name);
+                     goto out;
+             }
+     }
+
+     ret = jiffies_to_msecs(jiffies - start);

ret = ktime_sub(ktime_now(), start);

The downside to using ktime is remembering it is s64 and so requires care and attention in doing math.

Quoted 18 lines
Quoted 18 lines
drivers/gpu/drm/selftests/test-drm_mm.c +18 -0
+out:
+     drm_mm_for_each_node_safe(node, next, &mm)
+             drm_mm_remove_node(node);
+     drm_mm_takedown(&mm);
+     vfree(nodes);
+err:
+     return ret;
+
+}
+
+static int igt_frag(void *ignored)
+{
+     const struct insert_mode *mode;
+     unsigned int insert_time1, insert_time2;
+     unsigned int insert_size = 10000;
+     unsigned int scale_factor = 4;
+     /* tolerate 10% excess insertion duration */
+     unsigned int error_factor = 110;
Quoted 8 lines

drivers/gpu/drm/selftests/test-drm_mm.c static int igt_insert_range(void *ignored) · line 1085

Quoted 8 lines
drivers/gpu/drm/selftests/test-drm_mm.c +8 -0
+     int ret = -EINVAL;
+
+     for (mode = insert_modes; mode->name; mode++) {
+             unsigned int expected_time;
+
+             insert_time1 = get_insert_time(insert_size, mode);
+             if (insert_time1 < 0)
+                     goto err;

Ah, can you propagate the actual error. I see you are returning EINVAL for ENOMEM errors. Just wait until it hits and you have to debug why :)

Quoted 7 lines
Quoted 7 lines
drivers/gpu/drm/selftests/test-drm_mm.c +7 -0
+             insert_time2 = get_insert_time((insert_size * 2), mode);
+             if (insert_time2 < 0)
+                     goto err;
+
+             expected_time = (scale_factor * insert_time1 *
+                              error_factor)/100;
+             if (insert_time2 > expected_time) {
Quoted 8 lines

drivers/gpu/drm/selftests/test-drm_mm.c static int igt_insert_range(void *ignored) · line 1101

Quoted 8 lines
drivers/gpu/drm/selftests/test-drm_mm.c +8 -0
+                     pr_err("%s fragmented insert took more %u msecs\n",
+                            mode->name, insert_time2 - expected_time);
+                     goto err;
+             }
+
+             pr_info("%s fragmented insert of %u and %u insertions took %u and %u msecs\n",
+                     mode->name, insert_size, insert_size * 2, insert_time1,
+                     insert_time2);

Put the info first before the error. We always want the full details, with the error message explaining why it's unhappy.
-Chris
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#3 lore raw
Quoted 2 lines · Chris Wilson

Quoting Nirmoy (2020-05-29 16:40:53)

Quoted 1 line

This works correctly most of the times but sometimes

I have to take my word back. In another machine,  20k insertions in

best mode takes 6-9 times more than 10k insertions, all most all the time.

evict, bottom-up and top-down modes remains in 2-5 times range.

If I reduce the insertions to 1k and 2k then scaling factor for best mode stays  below 4 most of the time.

evict, bottom-up and top-down modes remains in 2-3 times range.

I wonder if it makes sense to test with only 1k and 2k insertions and tolerate more than error if the mode == best.

Regards,

Nirmoy

Quoted 131 lines
Quoted 2 lines

20k insertions can take more than 8 times of 10k insertion time.

The pressure is on to improve then :)

Quoted 53 lines

Regards,

Nirmoy

Quoted 48 lines · Nirmoy Das

This patch introduces fragmentation in the address range and measures time taken by 10k and 20k insertions. ig_frag() will fail if time taken by 20k insertions takes more than 4 times of 10k insertions as we know that insertions scale quadratically. Also tolerate 10% error because of kernel scheduler's jitters.

Output:
<snip>

[ 8092.653518] drm_mm: Testing DRM range manger (struct drm_mm), with random_seed=0x9bfb4117 max_iterations=8192 max_prime=128
[ 8092.653520] drm_mm: igt_sanitycheck - ok!
[ 8092.653525] igt_debug 0x0000000000000000-0x0000000000000200: 512: free
[ 8092.653526] igt_debug 0x0000000000000200-0x0000000000000600: 1024: used
[ 8092.653527] igt_debug 0x0000000000000600-0x0000000000000a00: 1024: free
[ 8092.653528] igt_debug 0x0000000000000a00-0x0000000000000e00: 1024: used
[ 8092.653529] igt_debug 0x0000000000000e00-0x0000000000001000: 512: free
[ 8092.653529] igt_debug total: 4096, used 2048 free 2048
[ 8112.569813] drm_mm: best fragmented insert of 10000 and 20000 insertions took 504 and 1996 msecs
[ 8112.723254] drm_mm: bottom-up fragmented insert of 10000 and 20000 insertions took 44 and 108 msecs
[ 8112.813212] drm_mm: top-down fragmented insert of 10000 and 20000 insertions took 40 and 44 msecs
[ 8112.847733] drm_mm: evict fragmented insert of 10000 and 20000 insertions took 8 and 20 msecs

<snip>

---
   drivers/gpu/drm/selftests/drm_mm_selftests.h |  1 +
   drivers/gpu/drm/selftests/test-drm_mm.c      | 73 ++++++++++++++++++++
   2 files changed, 74 insertions(+)
drivers/gpu/drm/selftests/drm_mm_selftests.h +1 -0
index 6b943ea1c57d..8c87c964176b 100644
@@ -14,6 +14,7 @@ selftest(insert, igt_insert)
   selftest(replace, igt_replace)
   selftest(insert_range, igt_insert_range)
   selftest(align, igt_align)
+selftest(frag, igt_frag)
   selftest(align32, igt_align32)
   selftest(align64, igt_align64)
   selftest(evict, igt_evict)
drivers/gpu/drm/selftests/test-drm_mm.c +0 -0
index 9aabe82dcd3a..05d8f3659b4d 100644
@@ -1033,6 +1033,79 @@ static int igt_insert_range(void *ignored)
       return 0;
   }
 
Quoted 16 lines
Quoted 6 lines
drivers/gpu/drm/selftests/test-drm_mm.c +6 -0
+static int get_insert_time(unsigned int num_insert,
+                        const struct insert_mode *mode)
+{
+     struct drm_mm mm;
+     struct drm_mm_node *nodes, *node, *next;
+     unsigned int size = 4096, align = 8192;

drivers/gpu/drm/selftests/test-drm_mm.c static int igt_insert_range(void *ignored) · line 1051

Quoted 10 lines
drivers/gpu/drm/selftests/test-drm_mm.c +10 -0
+     unsigned long start;
+     unsigned int i;
+     int ret = -EINVAL;
+
+     drm_mm_init(&mm, 1, U64_MAX - 2);
+     nodes = vzalloc(array_size(num_insert, sizeof(*nodes)));
+     if (!nodes)
+             goto err;
+
+     start = jiffies;

Use ktime_t start = ktime_now();

Quoted 8 lines

drivers/gpu/drm/selftests/test-drm_mm.c static int igt_insert_range(void *ignored) · line 1059

Quoted 8 lines
drivers/gpu/drm/selftests/test-drm_mm.c +8 -0
+     for (i = 0; i < num_insert; i++) {
+             if (!expect_insert(&mm, &nodes[i], size, align, i, mode)) {
+                     pr_err("%s insert failed\n", mode->name);
+                     goto out;
+             }
+     }
+
+     ret = jiffies_to_msecs(jiffies - start);

ret = ktime_sub(ktime_now(), start);

The downside to using ktime is remembering it is s64 and so requires care and attention in doing math.

Quoted 18 lines
Quoted 18 lines
drivers/gpu/drm/selftests/test-drm_mm.c +18 -0
+out:
+     drm_mm_for_each_node_safe(node, next, &mm)
+             drm_mm_remove_node(node);
+     drm_mm_takedown(&mm);
+     vfree(nodes);
+err:
+     return ret;
+
+}
+
+static int igt_frag(void *ignored)
+{
+     const struct insert_mode *mode;
+     unsigned int insert_time1, insert_time2;
+     unsigned int insert_size = 10000;
+     unsigned int scale_factor = 4;
+     /* tolerate 10% excess insertion duration */
+     unsigned int error_factor = 110;
Quoted 8 lines

drivers/gpu/drm/selftests/test-drm_mm.c static int igt_insert_range(void *ignored) · line 1085

Quoted 8 lines
drivers/gpu/drm/selftests/test-drm_mm.c +8 -0
+     int ret = -EINVAL;
+
+     for (mode = insert_modes; mode->name; mode++) {
+             unsigned int expected_time;
+
+             insert_time1 = get_insert_time(insert_size, mode);
+             if (insert_time1 < 0)
+                     goto err;

Ah, can you propagate the actual error. I see you are returning EINVAL for ENOMEM errors. Just wait until it hits and you have to debug why :)

Quoted 14 lines
Quoted 14 lines
drivers/gpu/drm/selftests/test-drm_mm.c +14 -0
+             insert_time2 = get_insert_time((insert_size * 2), mode);
+             if (insert_time2 < 0)
+                     goto err;
+
+             expected_time = (scale_factor * insert_time1 *
+                              error_factor)/100;
+             if (insert_time2 > expected_time) {
+                     pr_err("%s fragmented insert took more %u msecs\n",
+                            mode->name, insert_time2 - expected_time);
+                     goto err;
+             }
+
+             pr_info("%s fragmented insert of %u and %u insertions took %u and %u msecs\n",
+                     mode->name, insert_size, insert_size * 2, insert_time1,
Quoted 8 lines
Quoted 1 line

drivers/gpu/drm/selftests/test-drm_mm.c static int igt_insert_range(void *ignored) · line 1101

Quoted 1 line
drivers/gpu/drm/selftests/test-drm_mm.c +1 -0
+                     insert_time2);

Put the info first before the error. We always want the full details, with the error message explaining why it's unhappy.
-Chris
_______________________________________________
dri-devel mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Fdri-devel&amp;data=02%7C01%7Cnirmoy.das%40amd.com%7C5c7df129b9cf44b3ae4008d803e84445%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637263643415833767&amp;sdata=PrCQse4nhN0ZITT9OniuHhF7A5uxJD6ehk0PMjm7WMU%3D&amp;reserved=0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#4 lore raw

Nirmoy please keep in mind that your current implementation doesn't fully solve the issue the test case is exercising.

In other words what you have implement is fast skipping of fragmented address space for bottom-up and top-down.

But what this test here exercises is the fast skipping of aligned allocations. You should probably adjust the test case a bit.

Regards,
Christian.

Am 29.05.20 um 23:01 schrieb Nirmoy:

Quoted 15 lines · Chris Wilson
Quoted 2 lines

Quoting Nirmoy (2020-05-29 16:40:53)

Quoted 1 line

This works correctly most of the times but sometimes

I have to take my word back. In another machine,  20k insertions in

best mode takes 6-9 times more than 10k insertions, all most all the time.

evict, bottom-up and top-down modes remains in 2-5 times range.

If I reduce the insertions to 1k and 2k then scaling factor for best mode stays  below 4 most of the time.

Quoted 154 lines

evict, bottom-up and top-down modes remains in 2-3 times range.

I wonder if it makes sense to test with only 1k and 2k insertions and tolerate more than error if the mode == best.

Regards,

Nirmoy

Quoted 145 lines
Quoted 2 lines

20k insertions can take more than 8 times of 10k insertion time.

The pressure is on to improve then :)

Quoted 61 lines

Regards,

Nirmoy

Quoted 56 lines · Nirmoy Das

This patch introduces fragmentation in the address range and measures time taken by 10k and 20k insertions. ig_frag() will fail if time taken by 20k insertions takes more than 4 times of 10k insertions as we know that insertions scale quadratically. Also tolerate 10% error because of kernel scheduler's jitters.

Output:
<snip>

[ 8092.653518] drm_mm: Testing DRM range manger (struct drm_mm), with random_seed=0x9bfb4117 max_iterations=8192 max_prime=128
[ 8092.653520] drm_mm: igt_sanitycheck - ok!
[ 8092.653525] igt_debug 0x0000000000000000-0x0000000000000200: 512: free
[ 8092.653526] igt_debug 0x0000000000000200-0x0000000000000600: 1024: used
[ 8092.653527] igt_debug 0x0000000000000600-0x0000000000000a00: 1024: free
[ 8092.653528] igt_debug 0x0000000000000a00-0x0000000000000e00: 1024: used
[ 8092.653529] igt_debug 0x0000000000000e00-0x0000000000001000: 512: free
[ 8092.653529] igt_debug total: 4096, used 2048 free 2048
[ 8112.569813] drm_mm: best fragmented insert of 10000 and 20000 insertions took 504 and 1996 msecs
[ 8112.723254] drm_mm: bottom-up fragmented insert of 10000 and 20000 insertions took 44 and 108 msecs
[ 8112.813212] drm_mm: top-down fragmented insert of 10000 and 20000 insertions took 40 and 44 msecs
[ 8112.847733] drm_mm: evict fragmented insert of 10000 and 20000 insertions took 8 and 20 msecs

<snip>

---
   drivers/gpu/drm/selftests/drm_mm_selftests.h |  1 + drivers/gpu/drm/selftests/test-drm_mm.c      | 73
++++++++++++++++++++

   2 files changed, 74 insertions(+)
drivers/gpu/drm/selftests/drm_mm_selftests.h +1 -0
index 6b943ea1c57d..8c87c964176b 100644
@@ -14,6 +14,7 @@ selftest(insert, igt_insert)
    selftest(replace, igt_replace)
    selftest(insert_range, igt_insert_range)
    selftest(align, igt_align)
+selftest(frag, igt_frag)
    selftest(align32, igt_align32)
    selftest(align64, igt_align64)
    selftest(evict, igt_evict)
drivers/gpu/drm/selftests/test-drm_mm.c +7 -0
index 9aabe82dcd3a..05d8f3659b4d 100644
@@ -1033,6 +1033,79 @@ static int igt_insert_range(void *ignored)
        return 0;
    }
    +static int get_insert_time(unsigned int num_insert,
+                        const struct insert_mode *mode)
+{
+     struct drm_mm mm;
+     struct drm_mm_node *nodes, *node, *next;
+     unsigned int size = 4096, align = 8192;
+     unsigned long start;
+     unsigned int i;
Quoted 8 lines

drivers/gpu/drm/selftests/test-drm_mm.c static int igt_insert_range(void *ignored) · line 1051

Quoted 8 lines
drivers/gpu/drm/selftests/test-drm_mm.c +8 -0
+     int ret = -EINVAL;
+
+     drm_mm_init(&mm, 1, U64_MAX - 2);
+     nodes = vzalloc(array_size(num_insert, sizeof(*nodes)));
+     if (!nodes)
+             goto err;
+
+     start = jiffies;

Use ktime_t start = ktime_now();

Quoted 9 lines

drivers/gpu/drm/selftests/test-drm_mm.c static int igt_insert_range(void *ignored) · line 1059

Quoted 9 lines
drivers/gpu/drm/selftests/test-drm_mm.c +8 -0
+     for (i = 0; i < num_insert; i++) {
+             if (!expect_insert(&mm, &nodes[i], size, align, i, 
 mode)) {
+                     pr_err("%s insert failed\n", mode->name);
+                     goto out;
+             }
+     }
+
+     ret = jiffies_to_msecs(jiffies - start);

ret = ktime_sub(ktime_now(), start);

The downside to using ktime is remembering it is s64 and so requires care and attention in doing math.

Quoted 18 lines
Quoted 18 lines
drivers/gpu/drm/selftests/test-drm_mm.c +18 -0
+out:
+     drm_mm_for_each_node_safe(node, next, &mm)
+             drm_mm_remove_node(node);
+     drm_mm_takedown(&mm);
+     vfree(nodes);
+err:
+     return ret;
+
+}
+
+static int igt_frag(void *ignored)
+{
+     const struct insert_mode *mode;
+     unsigned int insert_time1, insert_time2;
+     unsigned int insert_size = 10000;
+     unsigned int scale_factor = 4;
+     /* tolerate 10% excess insertion duration */
+     unsigned int error_factor = 110;
Quoted 8 lines

drivers/gpu/drm/selftests/test-drm_mm.c static int igt_insert_range(void *ignored) · line 1085

Quoted 8 lines
drivers/gpu/drm/selftests/test-drm_mm.c +8 -0
+     int ret = -EINVAL;
+
+     for (mode = insert_modes; mode->name; mode++) {
+             unsigned int expected_time;
+
+             insert_time1 = get_insert_time(insert_size, mode);
+             if (insert_time1 < 0)
+                     goto err;

Ah, can you propagate the actual error. I see you are returning EINVAL for ENOMEM errors. Just wait until it hits and you have to debug why :)

Quoted 11 lines
Quoted 11 lines
drivers/gpu/drm/selftests/test-drm_mm.c +9 -0
+             insert_time2 = get_insert_time((insert_size * 2), mode);
+             if (insert_time2 < 0)
+                     goto err;
+
+             expected_time = (scale_factor * insert_time1 *
+                              error_factor)/100;
+             if (insert_time2 > expected_time) {
+                     pr_err("%s fragmented insert took more %u 
 msecs\n",
+                            mode->name, insert_time2 - 
 expected_time);
Quoted 8 lines
Quoted 8 lines
drivers/gpu/drm/selftests/test-drm_mm.c +4 -0
+                     goto err;
+             }
+
+             pr_info("%s fragmented insert of %u and %u insertions 

took %u and %u msecs\n",
+                     mode->name, insert_size, insert_size * 2, insert_time1,
+                     insert_time2);

Put the info first before the error. We always want the full details, with the error message explaining why it's unhappy.
-Chris
_______________________________________________
dri-devel mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Fdri-devel&amp;data=02%7C01%7Cnirmoy.das%40amd.com%7C5c7df129b9cf44b3ae4008d803e84445%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637263643415833767&amp;sdata=PrCQse4nhN0ZITT9OniuHhF7A5uxJD6ehk0PMjm7WMU%3D&amp;reserved=0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#5 lore raw

Hi Christian,

Quoted 5 lines · Christian König

Nirmoy please keep in mind that your current implementation doesn't fully solve the issue the test case is exercising.

In other words what you have implement is fast skipping of fragmented address space for bottom-up and top-down.

But what this test here exercises is the fast skipping of aligned allocations. You should probably adjust the test case a bit.

Allocations with size=4k and aign = 8k is known to introduce fragmentation, do you mean I should only test bottom-up and top-down

for now ?

Regards,

Nirmoy

Quoted 177 lines

Regards,
Christian.

Am 29.05.20 um 23:01 schrieb Nirmoy:

Quoted 170 lines · Chris Wilson
Quoted 2 lines

Quoting Nirmoy (2020-05-29 16:40:53)

Quoted 1 line

This works correctly most of the times but sometimes

I have to take my word back. In another machine,  20k insertions in

best mode takes 6-9 times more than 10k insertions, all most all the time.

evict, bottom-up and top-down modes remains in 2-5 times range.

If I reduce the insertions to 1k and 2k then scaling factor for best mode stays  below 4 most of the time.

evict, bottom-up and top-down modes remains in 2-3 times range.

I wonder if it makes sense to test with only 1k and 2k insertions and tolerate more than error if the mode == best.

Regards,

Nirmoy

Quoted 146 lines
Quoted 2 lines

20k insertions can take more than 8 times of 10k insertion time.

The pressure is on to improve then :)

Quoted 61 lines

Regards,

Nirmoy

Quoted 56 lines · Nirmoy Das

This patch introduces fragmentation in the address range and measures time taken by 10k and 20k insertions. ig_frag() will fail if time taken by 20k insertions takes more than 4 times of 10k insertions as we know that insertions scale quadratically. Also tolerate 10% error because of kernel scheduler's jitters.

Output:
<snip>

[ 8092.653518] drm_mm: Testing DRM range manger (struct drm_mm), with random_seed=0x9bfb4117 max_iterations=8192 max_prime=128
[ 8092.653520] drm_mm: igt_sanitycheck - ok!
[ 8092.653525] igt_debug 0x0000000000000000-0x0000000000000200: 512: free
[ 8092.653526] igt_debug 0x0000000000000200-0x0000000000000600: 1024: used
[ 8092.653527] igt_debug 0x0000000000000600-0x0000000000000a00: 1024: free
[ 8092.653528] igt_debug 0x0000000000000a00-0x0000000000000e00: 1024: used
[ 8092.653529] igt_debug 0x0000000000000e00-0x0000000000001000: 512: free
[ 8092.653529] igt_debug total: 4096, used 2048 free 2048
[ 8112.569813] drm_mm: best fragmented insert of 10000 and 20000 insertions took 504 and 1996 msecs
[ 8112.723254] drm_mm: bottom-up fragmented insert of 10000 and 20000 insertions took 44 and 108 msecs
[ 8112.813212] drm_mm: top-down fragmented insert of 10000 and 20000 insertions took 40 and 44 msecs
[ 8112.847733] drm_mm: evict fragmented insert of 10000 and 20000 insertions took 8 and 20 msecs

<snip>

---
   drivers/gpu/drm/selftests/drm_mm_selftests.h |  1 + drivers/gpu/drm/selftests/test-drm_mm.c      | 73
++++++++++++++++++++

   2 files changed, 74 insertions(+)
drivers/gpu/drm/selftests/drm_mm_selftests.h +1 -0
index 6b943ea1c57d..8c87c964176b 100644
@@ -14,6 +14,7 @@ selftest(insert, igt_insert)
    selftest(replace, igt_replace)
    selftest(insert_range, igt_insert_range)
    selftest(align, igt_align)
+selftest(frag, igt_frag)
    selftest(align32, igt_align32)
    selftest(align64, igt_align64)
    selftest(evict, igt_evict)
drivers/gpu/drm/selftests/test-drm_mm.c +7 -0
index 9aabe82dcd3a..05d8f3659b4d 100644
@@ -1033,6 +1033,79 @@ static int igt_insert_range(void *ignored)
        return 0;
    }
    +static int get_insert_time(unsigned int num_insert,
+                        const struct insert_mode *mode)
+{
+     struct drm_mm mm;
+     struct drm_mm_node *nodes, *node, *next;
+     unsigned int size = 4096, align = 8192;
+     unsigned long start;
+     unsigned int i;
Quoted 8 lines

drivers/gpu/drm/selftests/test-drm_mm.c static int igt_insert_range(void *ignored) · line 1051

Quoted 8 lines
drivers/gpu/drm/selftests/test-drm_mm.c +8 -0
+     int ret = -EINVAL;
+
+     drm_mm_init(&mm, 1, U64_MAX - 2);
+     nodes = vzalloc(array_size(num_insert, sizeof(*nodes)));
+     if (!nodes)
+             goto err;
+
+     start = jiffies;

Use ktime_t start = ktime_now();

Quoted 9 lines

drivers/gpu/drm/selftests/test-drm_mm.c static int igt_insert_range(void *ignored) · line 1059

Quoted 9 lines
drivers/gpu/drm/selftests/test-drm_mm.c +8 -0
+     for (i = 0; i < num_insert; i++) {
+             if (!expect_insert(&mm, &nodes[i], size, align, i, 
 mode)) {
+                     pr_err("%s insert failed\n", mode->name);
+                     goto out;
+             }
+     }
+
+     ret = jiffies_to_msecs(jiffies - start);

ret = ktime_sub(ktime_now(), start);

The downside to using ktime is remembering it is s64 and so requires care and attention in doing math.

Quoted 18 lines
Quoted 18 lines
drivers/gpu/drm/selftests/test-drm_mm.c +18 -0
+out:
+     drm_mm_for_each_node_safe(node, next, &mm)
+             drm_mm_remove_node(node);
+     drm_mm_takedown(&mm);
+     vfree(nodes);
+err:
+     return ret;
+
+}
+
+static int igt_frag(void *ignored)
+{
+     const struct insert_mode *mode;
+     unsigned int insert_time1, insert_time2;
+     unsigned int insert_size = 10000;
+     unsigned int scale_factor = 4;
+     /* tolerate 10% excess insertion duration */
+     unsigned int error_factor = 110;
Quoted 8 lines

drivers/gpu/drm/selftests/test-drm_mm.c static int igt_insert_range(void *ignored) · line 1085

Quoted 8 lines
drivers/gpu/drm/selftests/test-drm_mm.c +8 -0
+     int ret = -EINVAL;
+
+     for (mode = insert_modes; mode->name; mode++) {
+             unsigned int expected_time;
+
+             insert_time1 = get_insert_time(insert_size, mode);
+             if (insert_time1 < 0)
+                     goto err;

Ah, can you propagate the actual error. I see you are returning EINVAL for ENOMEM errors. Just wait until it hits and you have to debug why :)

Quoted 12 lines
Quoted 12 lines
drivers/gpu/drm/selftests/test-drm_mm.c +9 -0
+             insert_time2 = get_insert_time((insert_size * 2), 
 mode);
+             if (insert_time2 < 0)
+                     goto err;
+
+             expected_time = (scale_factor * insert_time1 *
+                              error_factor)/100;
+             if (insert_time2 > expected_time) {
+                     pr_err("%s fragmented insert took more %u 
 msecs\n",
+                            mode->name, insert_time2 - 

expected_time);

Quoted 8 lines
Quoted 8 lines

+                     goto err;
+             }
+
+             pr_info("%s fragmented insert of %u and %u insertions took %u and %u msecs\n",
+                     mode->name, insert_size, insert_size * 2, insert_time1,
+                     insert_time2);

Put the info first before the error. We always want the full details, with the error message explaining why it's unhappy.
-Chris
_______________________________________________
dri-devel mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Fdri-devel&amp;data=02%7C01%7Cnirmoy.das%40amd.com%7C5c7df129b9cf44b3ae4008d803e84445%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637263643415833767&amp;sdata=PrCQse4nhN0ZITT9OniuHhF7A5uxJD6ehk0PMjm7WMU%3D&amp;reserved=0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#6 lore raw

Am 02.06.20 um 16:13 schrieb Nirmoy:

Quoted 11 lines

Hi Christian,

Quoted 5 lines · Christian König

Nirmoy please keep in mind that your current implementation doesn't fully solve the issue the test case is exercising.

In other words what you have implement is fast skipping of fragmented address space for bottom-up and top-down.

But what this test here exercises is the fast skipping of aligned allocations. You should probably adjust the test case a bit.

Allocations with size=4k and aign = 8k is known to introduce fragmentation,

Yes, but this fragmentation can't be avoided with what we already implemented. For this we would need the extension with the alignment I already explained.

Quoted 3 lines

do you mean I should only test bottom-up and top-down

for now ?

Yes and no.

What we need to test is the following:

1. Make tons of allocations with size=4k and align=0.

2. Free every other of those allocations.

3. Make tons of allocations with size=8k and align=0.

Previously bottom-up and top-down would have checked all the holes created in step #2.

With your change they can immediately see that this doesn't make sense and shortcut to the leftmost/rightmost leaf node in the tree with the large free block.

That we can handle the alignment as well is the next step of that.

Regards,
Christian.

Quoted 184 lines

Regards,

Nirmoy

Quoted 177 lines

Regards,
Christian.

Am 29.05.20 um 23:01 schrieb Nirmoy:

Quoted 170 lines · Chris Wilson
Quoted 2 lines

Quoting Nirmoy (2020-05-29 16:40:53)

Quoted 1 line

This works correctly most of the times but sometimes

I have to take my word back. In another machine,  20k insertions in

best mode takes 6-9 times more than 10k insertions, all most all the time.

evict, bottom-up and top-down modes remains in 2-5 times range.

If I reduce the insertions to 1k and 2k then scaling factor for best mode stays  below 4 most of the time.

evict, bottom-up and top-down modes remains in 2-3 times range.

I wonder if it makes sense to test with only 1k and 2k insertions and tolerate more than error if the mode == best.

Regards,

Nirmoy

Quoted 146 lines
Quoted 2 lines

20k insertions can take more than 8 times of 10k insertion time.

The pressure is on to improve then :)

Quoted 61 lines

Regards,

Nirmoy

Quoted 56 lines · Nirmoy Das

This patch introduces fragmentation in the address range and measures time taken by 10k and 20k insertions. ig_frag() will fail if time taken by 20k insertions takes more than 4 times of 10k insertions as we know that insertions scale quadratically. Also tolerate 10% error because of kernel scheduler's jitters.

Output:
<snip>

[ 8092.653518] drm_mm: Testing DRM range manger (struct drm_mm), with random_seed=0x9bfb4117 max_iterations=8192 max_prime=128
[ 8092.653520] drm_mm: igt_sanitycheck - ok!
[ 8092.653525] igt_debug 0x0000000000000000-0x0000000000000200: 512: free
[ 8092.653526] igt_debug 0x0000000000000200-0x0000000000000600: 1024: used
[ 8092.653527] igt_debug 0x0000000000000600-0x0000000000000a00: 1024: free
[ 8092.653528] igt_debug 0x0000000000000a00-0x0000000000000e00: 1024: used
[ 8092.653529] igt_debug 0x0000000000000e00-0x0000000000001000: 512: free
[ 8092.653529] igt_debug total: 4096, used 2048 free 2048
[ 8112.569813] drm_mm: best fragmented insert of 10000 and 20000 insertions took 504 and 1996 msecs
[ 8112.723254] drm_mm: bottom-up fragmented insert of 10000 and 20000 insertions took 44 and 108 msecs
[ 8112.813212] drm_mm: top-down fragmented insert of 10000 and 20000 insertions took 40 and 44 msecs
[ 8112.847733] drm_mm: evict fragmented insert of 10000 and 20000 insertions took 8 and 20 msecs

<snip>

---
   drivers/gpu/drm/selftests/drm_mm_selftests.h |  1 + drivers/gpu/drm/selftests/test-drm_mm.c      | 73
++++++++++++++++++++

   2 files changed, 74 insertions(+)
drivers/gpu/drm/selftests/drm_mm_selftests.h +1 -0
index 6b943ea1c57d..8c87c964176b 100644
@@ -14,6 +14,7 @@ selftest(insert, igt_insert)
    selftest(replace, igt_replace)
    selftest(insert_range, igt_insert_range)
    selftest(align, igt_align)
+selftest(frag, igt_frag)
    selftest(align32, igt_align32)
    selftest(align64, igt_align64)
    selftest(evict, igt_evict)
drivers/gpu/drm/selftests/test-drm_mm.c +7 -0
index 9aabe82dcd3a..05d8f3659b4d 100644
@@ -1033,6 +1033,79 @@ static int igt_insert_range(void *ignored)
        return 0;
    }
    +static int get_insert_time(unsigned int num_insert,
+                        const struct insert_mode *mode)
+{
+     struct drm_mm mm;
+     struct drm_mm_node *nodes, *node, *next;
+     unsigned int size = 4096, align = 8192;
+     unsigned long start;
+     unsigned int i;
Quoted 8 lines

drivers/gpu/drm/selftests/test-drm_mm.c static int igt_insert_range(void *ignored) · line 1051

Quoted 8 lines
drivers/gpu/drm/selftests/test-drm_mm.c +8 -0
+     int ret = -EINVAL;
+
+     drm_mm_init(&mm, 1, U64_MAX - 2);
+     nodes = vzalloc(array_size(num_insert, sizeof(*nodes)));
+     if (!nodes)
+             goto err;
+
+     start = jiffies;

Use ktime_t start = ktime_now();

Quoted 9 lines

drivers/gpu/drm/selftests/test-drm_mm.c static int igt_insert_range(void *ignored) · line 1059

Quoted 9 lines
drivers/gpu/drm/selftests/test-drm_mm.c +8 -0
+     for (i = 0; i < num_insert; i++) {
+             if (!expect_insert(&mm, &nodes[i], size, align, i, 
 mode)) {
+                     pr_err("%s insert failed\n", mode->name);
+                     goto out;
+             }
+     }
+
+     ret = jiffies_to_msecs(jiffies - start);

ret = ktime_sub(ktime_now(), start);

The downside to using ktime is remembering it is s64 and so requires care and attention in doing math.

Quoted 18 lines
Quoted 18 lines
drivers/gpu/drm/selftests/test-drm_mm.c +18 -0
+out:
+     drm_mm_for_each_node_safe(node, next, &mm)
+             drm_mm_remove_node(node);
+     drm_mm_takedown(&mm);
+     vfree(nodes);
+err:
+     return ret;
+
+}
+
+static int igt_frag(void *ignored)
+{
+     const struct insert_mode *mode;
+     unsigned int insert_time1, insert_time2;
+     unsigned int insert_size = 10000;
+     unsigned int scale_factor = 4;
+     /* tolerate 10% excess insertion duration */
+     unsigned int error_factor = 110;
Quoted 8 lines

drivers/gpu/drm/selftests/test-drm_mm.c static int igt_insert_range(void *ignored) · line 1085

Quoted 8 lines
drivers/gpu/drm/selftests/test-drm_mm.c +8 -0
+     int ret = -EINVAL;
+
+     for (mode = insert_modes; mode->name; mode++) {
+             unsigned int expected_time;
+
+             insert_time1 = get_insert_time(insert_size, mode);
+             if (insert_time1 < 0)
+                     goto err;

Ah, can you propagate the actual error. I see you are returning EINVAL for ENOMEM errors. Just wait until it hits and you have to debug why :)

Quoted 12 lines
Quoted 12 lines
drivers/gpu/drm/selftests/test-drm_mm.c +9 -0
+             insert_time2 = get_insert_time((insert_size * 2), 
 mode);
+             if (insert_time2 < 0)
+                     goto err;
+
+             expected_time = (scale_factor * insert_time1 *
+                              error_factor)/100;
+             if (insert_time2 > expected_time) {
+                     pr_err("%s fragmented insert took more %u 
 msecs\n",
+                            mode->name, insert_time2 - 

expected_time);

Quoted 8 lines
Quoted 8 lines

+                     goto err;
+             }
+
+             pr_info("%s fragmented insert of %u and %u insertions took %u and %u msecs\n",
+                     mode->name, insert_size, insert_size * 2, insert_time1,
+                     insert_time2);

Put the info first before the error. We always want the full details, with the error message explaining why it's unhappy.
-Chris
_______________________________________________
dri-devel mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Fdri-devel&amp;data=02%7C01%7Cnirmoy.das%40amd.com%7C5c7df129b9cf44b3ae4008d803e84445%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637263643415833767&amp;sdata=PrCQse4nhN0ZITT9OniuHhF7A5uxJD6ehk0PMjm7WMU%3D&amp;reserved=0

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

#7 lore raw
Quoted 27 lines · Christian König

Am 02.06.20 um 16:13 schrieb Nirmoy:

Quoted 11 lines

Hi Christian,

Quoted 5 lines · Christian König

Nirmoy please keep in mind that your current implementation doesn't fully solve the issue the test case is exercising.

In other words what you have implement is fast skipping of fragmented address space for bottom-up and top-down.

But what this test here exercises is the fast skipping of aligned allocations. You should probably adjust the test case a bit.

Allocations with size=4k and aign = 8k is known to introduce fragmentation,

Yes, but this fragmentation can't be avoided with what we already implemented. For this we would need the extension with the alignment I already explained.

Quoted 3 lines

do you mean I should only test bottom-up and top-down

for now ?

Yes and no.

What we need to test is the following:

1. Make tons of allocations with size=4k and align=0.

2. Free every other of those allocations.

Quoted 7 lines

3. Make tons of allocations with size=8k and align=0.

Previously bottom-up and top-down would have checked all the holes created in step #2.

With your change they can immediately see that this doesn't make sense and shortcut to the leftmost/rightmost leaf node in the tree with the large free block.

That we can handle the alignment as well is the next step of that.

Thanks Christian for the detailed explanation. I have modified this as you suggested, will send in few minutes.

Regards,

Nirmoy

Quoted 189 lines

Regards,
Christian.

Quoted 184 lines

Regards,

Nirmoy

Quoted 177 lines

Regards,
Christian.

Am 29.05.20 um 23:01 schrieb Nirmoy:

Quoted 170 lines · Chris Wilson
Quoted 2 lines

Quoting Nirmoy (2020-05-29 16:40:53)

Quoted 1 line

This works correctly most of the times but sometimes

I have to take my word back. In another machine,  20k insertions in

best mode takes 6-9 times more than 10k insertions, all most all the time.

evict, bottom-up and top-down modes remains in 2-5 times range.

If I reduce the insertions to 1k and 2k then scaling factor for best mode stays  below 4 most of the time.

evict, bottom-up and top-down modes remains in 2-3 times range.

I wonder if it makes sense to test with only 1k and 2k insertions and tolerate more than error if the mode == best.

Regards,

Nirmoy

Quoted 146 lines
Quoted 2 lines

20k insertions can take more than 8 times of 10k insertion time.

The pressure is on to improve then :)

Quoted 61 lines

Regards,

Nirmoy

Quoted 56 lines · Nirmoy Das

This patch introduces fragmentation in the address range and measures time taken by 10k and 20k insertions. ig_frag() will fail if time taken by 20k insertions takes more than 4 times of 10k insertions as we know that insertions scale quadratically. Also tolerate 10% error because of kernel scheduler's jitters.

Output:
<snip>

[ 8092.653518] drm_mm: Testing DRM range manger (struct drm_mm), with random_seed=0x9bfb4117 max_iterations=8192 max_prime=128
[ 8092.653520] drm_mm: igt_sanitycheck - ok!
[ 8092.653525] igt_debug 0x0000000000000000-0x0000000000000200: 512: free
[ 8092.653526] igt_debug 0x0000000000000200-0x0000000000000600: 1024: used
[ 8092.653527] igt_debug 0x0000000000000600-0x0000000000000a00: 1024: free
[ 8092.653528] igt_debug 0x0000000000000a00-0x0000000000000e00: 1024: used
[ 8092.653529] igt_debug 0x0000000000000e00-0x0000000000001000: 512: free
[ 8092.653529] igt_debug total: 4096, used 2048 free 2048
[ 8112.569813] drm_mm: best fragmented insert of 10000 and 20000 insertions took 504 and 1996 msecs
[ 8112.723254] drm_mm: bottom-up fragmented insert of 10000 and 20000 insertions took 44 and 108 msecs
[ 8112.813212] drm_mm: top-down fragmented insert of 10000 and 20000 insertions took 40 and 44 msecs
[ 8112.847733] drm_mm: evict fragmented insert of 10000 and 20000 insertions took 8 and 20 msecs

<snip>

---
   drivers/gpu/drm/selftests/drm_mm_selftests.h |  1 + drivers/gpu/drm/selftests/test-drm_mm.c      | 73
++++++++++++++++++++

   2 files changed, 74 insertions(+)
drivers/gpu/drm/selftests/drm_mm_selftests.h +1 -0
index 6b943ea1c57d..8c87c964176b 100644
@@ -14,6 +14,7 @@ selftest(insert, igt_insert)
    selftest(replace, igt_replace)
    selftest(insert_range, igt_insert_range)
    selftest(align, igt_align)
+selftest(frag, igt_frag)
    selftest(align32, igt_align32)
    selftest(align64, igt_align64)
    selftest(evict, igt_evict)
drivers/gpu/drm/selftests/test-drm_mm.c +7 -0
index 9aabe82dcd3a..05d8f3659b4d 100644
@@ -1033,6 +1033,79 @@ static int igt_insert_range(void *ignored)
        return 0;
    }
    +static int get_insert_time(unsigned int num_insert,
+                        const struct insert_mode *mode)
+{
+     struct drm_mm mm;
+     struct drm_mm_node *nodes, *node, *next;
+     unsigned int size = 4096, align = 8192;
+     unsigned long start;
+     unsigned int i;
Quoted 8 lines

drivers/gpu/drm/selftests/test-drm_mm.c static int igt_insert_range(void *ignored) · line 1050

Quoted 8 lines
drivers/gpu/drm/selftests/test-drm_mm.c +8 -0
+     int ret = -EINVAL;
+
+     drm_mm_init(&mm, 1, U64_MAX - 2);
+     nodes = vzalloc(array_size(num_insert, sizeof(*nodes)));
+     if (!nodes)
+             goto err;
+
+     start = jiffies;

Use ktime_t start = ktime_now();

Quoted 9 lines

drivers/gpu/drm/selftests/test-drm_mm.c static int igt_insert_range(void *ignored) · line 1059

Quoted 9 lines
drivers/gpu/drm/selftests/test-drm_mm.c +8 -0
+     for (i = 0; i < num_insert; i++) {
+             if (!expect_insert(&mm, &nodes[i], size, align, i, 
 mode)) {
+                     pr_err("%s insert failed\n", mode->name);
+                     goto out;
+             }
+     }
+
+     ret = jiffies_to_msecs(jiffies - start);

ret = ktime_sub(ktime_now(), start);

The downside to using ktime is remembering it is s64 and so requires care and attention in doing math.

Quoted 18 lines
Quoted 18 lines
drivers/gpu/drm/selftests/test-drm_mm.c +18 -0
+out:
+     drm_mm_for_each_node_safe(node, next, &mm)
+             drm_mm_remove_node(node);
+     drm_mm_takedown(&mm);
+     vfree(nodes);
+err:
+     return ret;
+
+}
+
+static int igt_frag(void *ignored)
+{
+     const struct insert_mode *mode;
+     unsigned int insert_time1, insert_time2;
+     unsigned int insert_size = 10000;
+     unsigned int scale_factor = 4;
+     /* tolerate 10% excess insertion duration */
+     unsigned int error_factor = 110;
Quoted 8 lines

drivers/gpu/drm/selftests/test-drm_mm.c static int igt_insert_range(void *ignored) · line 1085

Quoted 8 lines
drivers/gpu/drm/selftests/test-drm_mm.c +8 -0
+     int ret = -EINVAL;
+
+     for (mode = insert_modes; mode->name; mode++) {
+             unsigned int expected_time;
+
+             insert_time1 = get_insert_time(insert_size, mode);
+             if (insert_time1 < 0)
+                     goto err;

Ah, can you propagate the actual error. I see you are returning EINVAL for ENOMEM errors. Just wait until it hits and you have to debug why :)

Quoted 12 lines
Quoted 12 lines
drivers/gpu/drm/selftests/test-drm_mm.c +9 -0
+             insert_time2 = get_insert_time((insert_size * 2), 
 mode);
+             if (insert_time2 < 0)
+                     goto err;
+
+             expected_time = (scale_factor * insert_time1 *
+                              error_factor)/100;
+             if (insert_time2 > expected_time) {
+                     pr_err("%s fragmented insert took more %u 
 msecs\n",
+                            mode->name, insert_time2 - 

expected_time);

Quoted 8 lines
Quoted 8 lines

+                     goto err;
+             }
+
+             pr_info("%s fragmented insert of %u and %u insertions took %u and %u msecs\n",
+                     mode->name, insert_size, insert_size * 2, insert_time1,
+                     insert_time2);

Put the info first before the error. We always want the full details, with the error message explaining why it's unhappy.
-Chris
_______________________________________________
dri-devel mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Fdri-devel&amp;data=02%7C01%7Cnirmoy.das%40amd.com%7C5c7df129b9cf44b3ae4008d803e84445%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637263643415833767&amp;sdata=PrCQse4nhN0ZITT9OniuHhF7A5uxJD6ehk0PMjm7WMU%3D&amp;reserved=0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#8 lore raw

[Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for series starting with [RFC,1/1] drm/mm: add ig_frag selftest

In reply to Nirmoy Das
== Series Details ==

== Series Details ==

Series: series starting with [RFC,1/1] drm/mm: add ig_frag selftest
URL : https://patchwork.freedesktop.org/series/77803/
State : warning

== Summary ==

$ dim checkpatch origin/drm-tip
320cc6810801 drm/mm: add ig_frag selftest
-:82: CHECK:BRACES: Blank lines aren't necessary before a close brace '}'
#82: FILE: drivers/gpu/drm/selftests/test-drm_mm.c:1068:
+
+}

-:106: CHECK:SPACING: spaces preferred around that '/' (ctx:VxV) #106: FILE: drivers/gpu/drm/selftests/test-drm_mm.c:1092:
+ error_factor)/100;
^

-:125: WARNING:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal patch author 'Nirmoy Das <[email protected]>'

total: 0 errors, 1 warnings, 2 checks, 86 lines checked

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

#9 lore raw

[Intel-gfx] ✓ Fi.CI.BAT: success for series starting with [RFC,1/1] drm/mm: add ig_frag selftest

In reply to Nirmoy Das
== Series Details ==

== Series Details ==

Series: series starting with [RFC,1/1] drm/mm: add ig_frag selftest
URL : https://patchwork.freedesktop.org/series/77803/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_8556 -> Patchwork_17823
====================================================

Summary
-------

**SUCCESS**

No regressions found.

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

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

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

### IGT changes ###

#### Possible fixes ####

* igt@i915_selftest@live@active:
- fi-bsw-n3050: [DMESG-FAIL][1] ([i915#541]) -> [PASS][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8556/fi-bsw-n3050/igt@i915_selftest@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17823/fi-bsw-n3050/igt@i915_selftest@[email protected]

[i915#541]: https://gitlab.freedesktop.org/drm/intel/issues/541

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

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

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

* Linux: CI_DRM_8556 -> Patchwork_17823

CI-20190529: 20190529
CI_DRM_8556: a12abc504361cc53eeb53c2948aebbd88709a901 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5684: bd399f5eb8263bb4a84ae6a5bb1a13d329e0515d @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_17823: 320cc6810801929affc6303c2481c0d2b735414e @ git://anongit.freedesktop.org/gfx-ci/linux

== Linux commits ==

320cc6810801 drm/mm: add ig_frag selftest

== Logs ==

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

#10 lore raw

[Intel-gfx] ✓ Fi.CI.IGT: success for series starting with [RFC,1/1] drm/mm: add ig_frag selftest

In reply to Nirmoy Das
== Series Details ==

== Series Details ==

Series: series starting with [RFC,1/1] drm/mm: add ig_frag selftest
URL : https://patchwork.freedesktop.org/series/77803/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_8556_full -> Patchwork_17823_full
====================================================

Summary
-------

**SUCCESS**

No regressions found.

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

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

### IGT changes ###

#### Possible regressions ####

* {igt@drm_mm@all@frag} (NEW):
- shard-apl: NOTRUN -> [DMESG-FAIL][1]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17823/shard-apl3/igt@drm_mm@[email protected]
- shard-tglb: NOTRUN -> [DMESG-FAIL][2]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17823/shard-tglb1/igt@drm_mm@[email protected]
- shard-glk: NOTRUN -> [DMESG-FAIL][3]
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17823/shard-glk8/igt@drm_mm@[email protected]

New tests
---------

New tests have been introduced between CI_DRM_8556_full and Patchwork_17823_full:

### New IGT tests (1) ###

* igt@drm_mm@all@frag:
- Statuses : 3 dmesg-fail(s) 4 pass(s)
- Exec time: [2.53, 33.41] s

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

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

### IGT changes ###

#### Issues hit ####

* igt@gem_exec_suspend@basic-s3:
- shard-kbl: [PASS][4] -> [DMESG-WARN][5] ([i915#180]) +3 similar issues
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8556/shard-kbl7/igt@[email protected]
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17823/shard-kbl6/igt@[email protected]

* igt@gen9_exec_parse@allowed-all:
- shard-apl: [PASS][6] -> [DMESG-WARN][7] ([i915#1436] / [i915#716])
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8556/shard-apl3/igt@[email protected]
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17823/shard-apl6/igt@[email protected]

* igt@kms_cursor_crc@pipe-b-cursor-256x85-sliding:
- shard-kbl: [PASS][8] -> [FAIL][9] ([i915#54])
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8556/shard-kbl2/igt@[email protected]
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17823/shard-kbl4/igt@[email protected]
- shard-skl: [PASS][10] -> [FAIL][11] ([i915#54])
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8556/shard-skl2/igt@[email protected]
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17823/shard-skl4/igt@[email protected]
- shard-apl: [PASS][12] -> [FAIL][13] ([i915#54])
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8556/shard-apl7/igt@[email protected]
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17823/shard-apl6/igt@[email protected]

* igt@kms_cursor_crc@pipe-c-cursor-suspend:
- shard-apl: [PASS][14] -> [DMESG-WARN][15] ([i915#180]) +1 similar issue
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8556/shard-apl3/igt@[email protected]
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17823/shard-apl1/igt@[email protected]

* igt@kms_cursor_legacy@flip-vs-cursor-crc-atomic:
- shard-kbl: [PASS][16] -> [FAIL][17] ([i915#1566] / [i915#93] / [i915#95])
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8556/shard-kbl4/igt@[email protected]
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17823/shard-kbl3/igt@[email protected]

* igt@kms_cursor_legacy@pipe-d-torture-bo:
- shard-tglb: [PASS][18] -> [DMESG-WARN][19] ([i915#128])
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8556/shard-tglb5/igt@[email protected]
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17823/shard-tglb7/igt@[email protected]

* igt@kms_psr@psr2_primary_page_flip:
- shard-iclb: [PASS][20] -> [SKIP][21] ([fdo#109441]) +3 similar issues
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8556/shard-iclb2/igt@kms_psr@psr2_primary_page_flip.html
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17823/shard-iclb7/igt@kms_psr@psr2_primary_page_flip.html

#### Possible fixes ####

* {igt@gem_exec_reloc@basic-concurrent0}:
- shard-glk: [FAIL][22] ([i915#1930]) -> [PASS][23]
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8556/shard-glk6/igt@[email protected]
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17823/shard-glk8/igt@[email protected]

* igt@i915_pm_rpm@system-suspend-execbuf:
- shard-tglb: [INCOMPLETE][24] ([i915#456]) -> [PASS][25]
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8556/shard-tglb6/igt@[email protected]
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17823/shard-tglb6/igt@[email protected]

* igt@i915_suspend@fence-restore-untiled:
- shard-kbl: [DMESG-WARN][26] ([i915#180] / [i915#93] / [i915#95]) -> [PASS][27]
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8556/shard-kbl2/igt@[email protected]
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17823/shard-kbl3/igt@[email protected]

* igt@i915_suspend@forcewake:
- shard-kbl: [INCOMPLETE][28] ([i915#155]) -> [PASS][29]
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8556/shard-kbl3/igt@[email protected]
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17823/shard-kbl7/igt@[email protected]

* igt@kms_big_fb@y-tiled-64bpp-rotate-0:
- shard-glk: [FAIL][30] ([i915#1119] / [i915#118] / [i915#95]) -> [PASS][31]
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8556/shard-glk8/igt@[email protected]
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17823/shard-glk6/igt@[email protected]

* igt@kms_cursor_crc@pipe-a-cursor-256x85-random:
- shard-skl: [FAIL][32] ([i915#54]) -> [PASS][33]
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8556/shard-skl1/igt@[email protected]
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17823/shard-skl5/igt@[email protected]

* igt@kms_cursor_crc@pipe-a-cursor-suspend:
- shard-kbl: [DMESG-WARN][34] ([i915#180]) -> [PASS][35] +1 similar issue
[34]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8556/shard-kbl7/igt@[email protected]
[35]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17823/shard-kbl6/igt@[email protected]

* igt@kms_cursor_edge_walk@pipe-a-256x256-top-edge:
- shard-glk: [TIMEOUT][36] ([i915#1958]) -> [PASS][37] +2 similar issues
[36]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8556/shard-glk7/igt@[email protected]
[37]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17823/shard-glk5/igt@[email protected]

* igt@kms_cursor_legacy@cursora-vs-flipb-toggle:
- shard-glk: [DMESG-FAIL][38] ([i915#1925] / [i915#1926]) -> [PASS][39]
[38]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8556/shard-glk2/igt@[email protected]
[39]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17823/shard-glk1/igt@[email protected]

* {igt@kms_flip@2x-flip-vs-expired-vblank-interruptible@ab-hdmi-a1-hdmi-a2}:
- shard-glk: [FAIL][40] ([i915#79]) -> [PASS][41]
[40]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8556/shard-glk1/igt@kms_flip@[email protected]
[41]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17823/shard-glk7/igt@kms_flip@[email protected]

* {igt@kms_flip@flip-vs-suspend-interruptible@c-dp1}:
- shard-apl: [DMESG-WARN][42] ([i915#180]) -> [PASS][43] +3 similar issues
[42]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8556/shard-apl2/igt@kms_flip@[email protected]
[43]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17823/shard-apl7/igt@kms_flip@[email protected]

* igt@kms_frontbuffer_tracking@fbc-1p-offscren-pri-indfb-draw-blt:
- shard-iclb: [FAIL][44] ([i915#49]) -> [PASS][45]
[44]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8556/shard-iclb2/igt@[email protected]
[45]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17823/shard-iclb1/igt@[email protected]

* igt@kms_hdr@bpc-switch-dpms:
- shard-skl: [FAIL][46] ([i915#1188]) -> [PASS][47]
[46]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8556/shard-skl3/igt@[email protected]
[47]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17823/shard-skl6/igt@[email protected]

* igt@kms_plane_alpha_blend@pipe-b-coverage-7efc:
- shard-skl: [FAIL][48] ([fdo#108145] / [i915#265]) -> [PASS][49] +1 similar issue
[48]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8556/shard-skl4/igt@[email protected]
[49]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17823/shard-skl7/igt@[email protected]

* igt@kms_plane_multiple@atomic-pipe-b-tiling-yf:
- shard-glk: [INCOMPLETE][50] ([i915#1927] / [i915#58] / [k.org#198133]) -> [PASS][51]
[50]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8556/shard-glk2/igt@[email protected]
[51]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17823/shard-glk4/igt@[email protected]

* igt@kms_psr@psr2_basic:
- shard-iclb: [SKIP][52] ([fdo#109441]) -> [PASS][53] +1 similar issue
[52]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8556/shard-iclb6/igt@kms_psr@psr2_basic.html
[53]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17823/shard-iclb2/igt@kms_psr@psr2_basic.html

#### Warnings ####

* igt@i915_pm_dc@dc3co-vpb-simulation:
- shard-iclb: [SKIP][54] ([i915#658]) -> [SKIP][55] ([i915#588])
[54]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8556/shard-iclb8/igt@[email protected]
[55]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17823/shard-iclb2/igt@[email protected]

* igt@kms_content_protection@legacy:
- shard-apl: [DMESG-FAIL][56] ([fdo#110321]) -> [TIMEOUT][57] ([i915#1319] / [i915#1635])
[56]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8556/shard-apl2/igt@[email protected]
[57]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17823/shard-apl8/igt@[email protected]

* igt@kms_content_protection@uevent:
- shard-kbl: [FAIL][58] ([i915#357]) -> [FAIL][59] ([i915#357] / [i915#93] / [i915#95])
[58]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8556/shard-kbl3/igt@[email protected]
[59]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17823/shard-kbl1/igt@[email protected]
- shard-apl: [FAIL][60] ([i915#357]) -> [FAIL][61] ([i915#357] / [i915#95])
[60]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8556/shard-apl1/igt@[email protected]
[61]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17823/shard-apl2/igt@[email protected]

* igt@kms_frontbuffer_tracking@psr-2p-scndscrn-pri-shrfb-draw-mmap-gtt:
- shard-glk: [TIMEOUT][62] ([i915#1958]) -> [SKIP][63] ([fdo#109271])
[62]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8556/shard-glk7/igt@kms_frontbuffer_tracking@psr-2p-scndscrn-pri-shrfb-draw-mmap-gtt.html
[63]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17823/shard-glk5/igt@kms_frontbuffer_tracking@psr-2p-scndscrn-pri-shrfb-draw-mmap-gtt.html

* igt@kms_plane_alpha_blend@pipe-c-alpha-basic:
- shard-apl: [FAIL][64] ([fdo#108145] / [i915#265] / [i915#95]) -> [FAIL][65] ([fdo#108145] / [i915#265])
[64]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8556/shard-apl7/igt@[email protected]
[65]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17823/shard-apl2/igt@[email protected]

{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).

[fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109441]: https://bugs.freedesktop.org/show_bug.cgi?id=109441
[fdo#110321]: https://bugs.freedesktop.org/show_bug.cgi?id=110321
[i915#1119]: https://gitlab.freedesktop.org/drm/intel/issues/1119
[i915#118]: https://gitlab.freedesktop.org/drm/intel/issues/118
[i915#1188]: https://gitlab.freedesktop.org/drm/intel/issues/1188
[i915#128]: https://gitlab.freedesktop.org/drm/intel/issues/128
[i915#1319]: https://gitlab.freedesktop.org/drm/intel/issues/1319
[i915#1436]: https://gitlab.freedesktop.org/drm/intel/issues/1436
[i915#1542]: https://gitlab.freedesktop.org/drm/intel/issues/1542
[i915#155]: https://gitlab.freedesktop.org/drm/intel/issues/155
[i915#1566]: https://gitlab.freedesktop.org/drm/intel/issues/1566
[i915#1635]: https://gitlab.freedesktop.org/drm/intel/issues/1635
[i915#180]: https://gitlab.freedesktop.org/drm/intel/issues/180
[i915#1925]: https://gitlab.freedesktop.org/drm/intel/issues/1925
[i915#1926]: https://gitlab.freedesktop.org/drm/intel/issues/1926
[i915#1927]: https://gitlab.freedesktop.org/drm/intel/issues/1927
[i915#1930]: https://gitlab.freedesktop.org/drm/intel/issues/1930
[i915#1958]: https://gitlab.freedesktop.org/drm/intel/issues/1958
[i915#198]: https://gitlab.freedesktop.org/drm/intel/issues/198
[i915#265]: https://gitlab.freedesktop.org/drm/intel/issues/265
[i915#357]: https://gitlab.freedesktop.org/drm/intel/issues/357
[i915#456]: https://gitlab.freedesktop.org/drm/intel/issues/456
[i915#49]: https://gitlab.freedesktop.org/drm/intel/issues/49
[i915#54]: https://gitlab.freedesktop.org/drm/intel/issues/54
[i915#58]: https://gitlab.freedesktop.org/drm/intel/issues/58
[i915#588]: https://gitlab.freedesktop.org/drm/intel/issues/588
[i915#658]: https://gitlab.freedesktop.org/drm/intel/issues/658
[i915#716]: https://gitlab.freedesktop.org/drm/intel/issues/716
[i915#79]: https://gitlab.freedesktop.org/drm/intel/issues/79
[i915#93]: https://gitlab.freedesktop.org/drm/intel/issues/93
[i915#95]: https://gitlab.freedesktop.org/drm/intel/issues/95
[k.org#198133]: https://bugzilla.kernel.org/show_bug.cgi?id=198133

Participating hosts (11 -> 11)
------------------------------

No changes in participating hosts

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

* Linux: CI_DRM_8556 -> Patchwork_17823

CI-20190529: 20190529
CI_DRM_8556: a12abc504361cc53eeb53c2948aebbd88709a901 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5684: bd399f5eb8263bb4a84ae6a5bb1a13d329e0515d @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_17823: 320cc6810801929affc6303c2481c0d2b735414e @ git://anongit.freedesktop.org/gfx-ci/linux
piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit

== Logs ==

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

#11 lore raw
In reply to Nirmoy Das
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system. BTW, we also suggest to use '--base' option to specify the base tree in git format-patch, please…

Hi Nirmoy,

[FYI, it's a private test report for your RFC patch.]
[auto build test WARNING on drm-intel/for-linux-next]
[also build test WARNING on drm-tip/drm-tip drm-exynos/exynos-drm-next tegra-drm/drm/tegra/for-next linus/master v5.7-rc7 next-20200529] [if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Nirmoy-Das/drm-mm-add-ig_frag-selftest/20200601-005135
base:   git://anongit.freedesktop.org/drm-intel for-linux-next
config: arc-randconfig-m031-20200531 (attached as .config)
compiler: arc-elf-gcc (GCC) 9.3.0

If you fix the issue, kindly add following tag as appropriate

smatch warnings:
drivers/gpu/drm/selftests/test-drm_mm.c:1084 igt_frag() warn: unsigned 'insert_time1' is never less than zero. drivers/gpu/drm/selftests/test-drm_mm.c:1088 igt_frag() warn: unsigned 'insert_time2' is never less than zero.

vim +/insert_time1 +1084 drivers/gpu/drm/selftests/test-drm_mm.c

1069
1070 static int igt_frag(void *ignored)
1071 {
1072 const struct insert_mode *mode;
1073 unsigned int insert_time1, insert_time2;
1074 unsigned int insert_size = 10000;
1075 unsigned int scale_factor = 4;
1076 /* tolerate 10% excess insertion duration */
1077 unsigned int error_factor = 110;
1078 int ret = -EINVAL;
1079
1080 for (mode = insert_modes; mode->name; mode++) {
1081 unsigned int expected_time;
1082
1083 insert_time1 = get_insert_time(insert_size, mode);

> 1084			if (insert_time1 < 0)
  1085				goto err;
  1086	
  1087			insert_time2 = get_insert_time((insert_size * 2), mode);
> 1088			if (insert_time2 < 0)

1089 goto err;
1090
1091 expected_time = (scale_factor * insert_time1 *
1092 error_factor)/100;
1093 if (insert_time2 > expected_time) {
1094 pr_err("%s fragmented insert took more %u msecs\n",
1095 mode->name, insert_time2 - expected_time);
1096 goto err;
1097 }
1098
1099 pr_info("%s fragmented insert of %u and %u insertions took %u and %u msecs\n",
1100 mode->name, insert_size, insert_size * 2, insert_time1,
1101 insert_time2);
1102 }
1103
1104 ret = 0;
1105 err:
1106 return ret;
1107 }
1108

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

#12 lore raw
In reply to Nirmoy Das
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system. BTW, we also suggest to use '--base' option to specify the base tree in git format-patch, please…

Hi Nirmoy,

[FYI, it's a private test report for your RFC patch.]
[auto build test WARNING on drm-intel/for-linux-next]
[also build test WARNING on drm-tip/drm-tip drm-exynos/exynos-drm-next tegra-drm/drm/tegra/for-next linus/master v5.7-rc7 next-20200529] [if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Nirmoy-Das/drm-mm-add-ig_frag-selftest/20200601-005135
base:   git://anongit.freedesktop.org/drm-intel for-linux-next
config: mips-randconfig-c022-20200531 (attached as .config)
compiler: mipsel-linux-gcc (GCC) 9.3.0

If you fix the issue, kindly add following tag as appropriate

All warnings (new ones prefixed by >>, old ones prefixed by <<):

drivers/gpu/drm/selftests/test-drm_mm.c: In function 'assert_no_holes':
drivers/gpu/drm/selftests/test-drm_mm.c:56:18: warning: variable 'hole_end' set but not used [-Wunused-but-set-variable] 56 | u64 hole_start, hole_end;
| ^~~~~~~~
drivers/gpu/drm/selftests/test-drm_mm.c: In function 'igt_frag':

>> drivers/gpu/drm/selftests/test-drm_mm.c:1084:20: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]

1084 | if (insert_time1 < 0)
| ^
drivers/gpu/drm/selftests/test-drm_mm.c:1088:20: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
1088 | if (insert_time2 < 0)
| ^

coccinelle warnings: (new ones prefixed by >>)

>> drivers/gpu/drm/selftests/test-drm_mm.c:1084:6-18: WARNING: Unsigned expression compared with zero: insert_time1 < 0
>> drivers/gpu/drm/selftests/test-drm_mm.c:1088:6-18: WARNING: Unsigned expression compared with zero: insert_time2 < 0

vim +1084 drivers/gpu/drm/selftests/test-drm_mm.c

1069
1070 static int igt_frag(void *ignored)
1071 {
1072 const struct insert_mode *mode;
1073 unsigned int insert_time1, insert_time2;
1074 unsigned int insert_size = 10000;
1075 unsigned int scale_factor = 4;
1076 /* tolerate 10% excess insertion duration */
1077 unsigned int error_factor = 110;
1078 int ret = -EINVAL;
1079
1080 for (mode = insert_modes; mode->name; mode++) {
1081 unsigned int expected_time;
1082
1083 insert_time1 = get_insert_time(insert_size, mode);

> 1084			if (insert_time1 < 0)
  1085				goto err;
  1086	
  1087			insert_time2 = get_insert_time((insert_size * 2), mode);
> 1088			if (insert_time2 < 0)

1089 goto err;
1090
1091 expected_time = (scale_factor * insert_time1 *
1092 error_factor)/100;
1093 if (insert_time2 > expected_time) {
1094 pr_err("%s fragmented insert took more %u msecs\n",
1095 mode->name, insert_time2 - expected_time);
1096 goto err;
1097 }
1098
1099 pr_info("%s fragmented insert of %u and %u insertions took %u and %u msecs\n",
1100 mode->name, insert_size, insert_size * 2, insert_time1,
1101 insert_time2);
1102 }
1103
1104 ret = 0;
1105 err:
1106 return ret;
1107 }
1108

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org