All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915/selftests: Report ENOMEM clearly for an allocation failure
@ 2017-11-17 10:17 Chris Wilson
  2017-11-17 10:40 ` ✓ Fi.CI.BAT: success for " Patchwork
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Chris Wilson @ 2017-11-17 10:17 UTC (permalink / raw)
  To: intel-gfx; +Cc: Matthew Auld

If we can not run the drunk_hole test because we couldn't allocate the
memory for the permutation array (even after we tried trimming the
size), report a clear ENOMEM. Similary, if we are asked to operate on a
hole too small for ourselves, make it skip quietly.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Matthew Auld <matthew.auld@intel.com>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
---
 drivers/gpu/drm/i915/selftests/i915_gem_gtt.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c b/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
index 3dcf886a2802..d0ce496606ed 100644
--- a/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
+++ b/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
@@ -705,12 +705,18 @@ static int drunk_hole(struct drm_i915_private *i915,
 		if (hole_size > KMALLOC_MAX_SIZE / sizeof(u32))
 			hole_size = KMALLOC_MAX_SIZE / sizeof(u32);
 		count = hole_size;
+		if (!count) {
+			pr_debug("%s: hole is too small [%llx - %llx] >> %d: %d\n",
+				 __func__, hole_start, hole_end, size, count);
+			break;
+		}
+
 		do {
 			count >>= 1;
 			order = i915_random_order(count, &prng);
 		} while (!order && count);
 		if (!order)
-			break;
+			return -ENOMEM;
 
 		/* Ignore allocation failures (i.e. don't report them as
 		 * a test failure) as we are purposefully allocating very
-- 
2.15.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* ✓ Fi.CI.BAT: success for drm/i915/selftests: Report ENOMEM clearly for an allocation failure
  2017-11-17 10:17 [PATCH] drm/i915/selftests: Report ENOMEM clearly for an allocation failure Chris Wilson
@ 2017-11-17 10:40 ` Patchwork
  2017-11-17 11:09 ` [PATCH] " Matthew Auld
  2017-11-17 11:56 ` ✓ Fi.CI.IGT: success for " Patchwork
  2 siblings, 0 replies; 8+ messages in thread
From: Patchwork @ 2017-11-17 10:40 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: drm/i915/selftests: Report ENOMEM clearly for an allocation failure
URL   : https://patchwork.freedesktop.org/series/33994/
State : success

== Summary ==

Series 33994v1 drm/i915/selftests: Report ENOMEM clearly for an allocation failure
https://patchwork.freedesktop.org/api/1.0/series/33994/revisions/1/mbox/

Test kms_cursor_legacy:
        Subgroup basic-busy-flip-before-cursor-legacy:
                fail       -> PASS       (fi-gdg-551) fdo#102618
Test kms_pipe_crc_basic:
        Subgroup suspend-read-crc-pipe-b:
                incomplete -> PASS       (fi-snb-2520m) fdo#103713

fdo#102618 https://bugs.freedesktop.org/show_bug.cgi?id=102618
fdo#103713 https://bugs.freedesktop.org/show_bug.cgi?id=103713

fi-bdw-5557u     total:289  pass:268  dwarn:0   dfail:0   fail:0   skip:21  time:448s
fi-blb-e6850     total:289  pass:223  dwarn:1   dfail:0   fail:0   skip:65  time:379s
fi-bsw-n3050     total:289  pass:243  dwarn:0   dfail:0   fail:0   skip:46  time:538s
fi-bwr-2160      total:289  pass:183  dwarn:0   dfail:0   fail:0   skip:106 time:279s
fi-bxt-dsi       total:289  pass:259  dwarn:0   dfail:0   fail:0   skip:30  time:508s
fi-bxt-j4205     total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:508s
fi-byt-j1900     total:289  pass:254  dwarn:0   dfail:0   fail:0   skip:35  time:498s
fi-byt-n2820     total:289  pass:250  dwarn:0   dfail:0   fail:0   skip:39  time:501s
fi-elk-e7500     total:289  pass:229  dwarn:0   dfail:0   fail:0   skip:60  time:430s
fi-gdg-551       total:289  pass:178  dwarn:1   dfail:0   fail:1   skip:109 time:264s
fi-glk-1         total:289  pass:261  dwarn:0   dfail:0   fail:0   skip:28  time:539s
fi-hsw-4770      total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:432s
fi-hsw-4770r     total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:443s
fi-ilk-650       total:289  pass:228  dwarn:0   dfail:0   fail:0   skip:61  time:429s
fi-ivb-3520m     total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:486s
fi-ivb-3770      total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:461s
fi-kbl-7500u     total:289  pass:264  dwarn:1   dfail:0   fail:0   skip:24  time:487s
fi-kbl-7560u     total:289  pass:270  dwarn:0   dfail:0   fail:0   skip:19  time:534s
fi-kbl-7567u     total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:477s
fi-kbl-r         total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:528s
fi-pnv-d510      total:289  pass:222  dwarn:1   dfail:0   fail:0   skip:66  time:577s
fi-skl-6260u     total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:461s
fi-skl-6600u     total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:547s
fi-skl-6700hq    total:289  pass:263  dwarn:0   dfail:0   fail:0   skip:26  time:565s
fi-skl-6700k     total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  time:528s
fi-skl-6770hq    total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:503s
fi-skl-gvtdvm    total:289  pass:266  dwarn:0   dfail:0   fail:0   skip:23  time:460s
fi-snb-2520m     total:289  pass:250  dwarn:0   dfail:0   fail:0   skip:39  time:557s
fi-snb-2600      total:289  pass:249  dwarn:0   dfail:0   fail:0   skip:40  time:425s
Blacklisted hosts:
fi-cfl-s2        total:289  pass:263  dwarn:0   dfail:0   fail:0   skip:26  time:608s

7cb3896259a7b9c0aa5ce0d09398704edb680607 drm-tip: 2017y-11m-17d-10h-07m-29s UTC integration manifest
a04daba2d3b2 drm/i915/selftests: Report ENOMEM clearly for an allocation failure

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_7166/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] drm/i915/selftests: Report ENOMEM clearly for an allocation failure
  2017-11-17 10:17 [PATCH] drm/i915/selftests: Report ENOMEM clearly for an allocation failure Chris Wilson
  2017-11-17 10:40 ` ✓ Fi.CI.BAT: success for " Patchwork
@ 2017-11-17 11:09 ` Matthew Auld
  2017-11-17 11:56 ` ✓ Fi.CI.IGT: success for " Patchwork
  2 siblings, 0 replies; 8+ messages in thread
From: Matthew Auld @ 2017-11-17 11:09 UTC (permalink / raw)
  To: Chris Wilson; +Cc: Intel Graphics Development, Matthew Auld

On 17 November 2017 at 10:17, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> If we can not run the drunk_hole test because we couldn't allocate the
> memory for the permutation array (even after we tried trimming the
> size), report a clear ENOMEM. Similary, if we are asked to operate on a
> hole too small for ourselves, make it skip quietly.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Matthew Auld <matthew.auld@intel.com>
> Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Reviewed-by:  Matthew Auld <matthew.auld@intel.com>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 8+ messages in thread

* ✓ Fi.CI.IGT: success for drm/i915/selftests: Report ENOMEM clearly for an allocation failure
  2017-11-17 10:17 [PATCH] drm/i915/selftests: Report ENOMEM clearly for an allocation failure Chris Wilson
  2017-11-17 10:40 ` ✓ Fi.CI.BAT: success for " Patchwork
  2017-11-17 11:09 ` [PATCH] " Matthew Auld
@ 2017-11-17 11:56 ` Patchwork
  2017-11-17 12:35   ` Chris Wilson
  2 siblings, 1 reply; 8+ messages in thread
From: Patchwork @ 2017-11-17 11:56 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: drm/i915/selftests: Report ENOMEM clearly for an allocation failure
URL   : https://patchwork.freedesktop.org/series/33994/
State : success

== Summary ==

Test kms_busy:
        Subgroup extended-modeset-hang-newfb-with-reset-render-a:
                skip       -> PASS       (shard-hsw) fdo#102249
Test kms_frontbuffer_tracking:
        Subgroup fbc-1p-primscrn-pri-shrfb-draw-mmap-gtt:
                skip       -> PASS       (shard-hsw) fdo#103167
        Subgroup fbc-1p-offscren-pri-shrfb-draw-render:
                pass       -> FAIL       (shard-snb) fdo#101623
Test kms_atomic_transition:
        Subgroup 1x-modeset-transitions-fencing:
                skip       -> PASS       (shard-hsw)
Test kms_plane:
        Subgroup plane-position-hole-pipe-a-planes:
                skip       -> PASS       (shard-hsw)
Test kms_cursor_legacy:
        Subgroup flip-vs-cursor-varying-size:
                fail       -> PASS       (shard-hsw) fdo#102670
Test drv_module_reload:
        Subgroup basic-reload:
                pass       -> DMESG-WARN (shard-snb) fdo#102848
                pass       -> DMESG-WARN (shard-hsw) fdo#102707 +1
Test kms_flip:
        Subgroup blt-wf_vblank-vs-dpms-interruptible:
                skip       -> PASS       (shard-hsw) fdo#102614
        Subgroup vblank-vs-modeset-suspend-interruptible:
                skip       -> PASS       (shard-hsw)

fdo#102249 https://bugs.freedesktop.org/show_bug.cgi?id=102249
fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
fdo#101623 https://bugs.freedesktop.org/show_bug.cgi?id=101623
fdo#102670 https://bugs.freedesktop.org/show_bug.cgi?id=102670
fdo#102848 https://bugs.freedesktop.org/show_bug.cgi?id=102848
fdo#102707 https://bugs.freedesktop.org/show_bug.cgi?id=102707
fdo#102614 https://bugs.freedesktop.org/show_bug.cgi?id=102614

shard-hsw        total:2585 pass:1472 dwarn:3   dfail:1   fail:10  skip:1099 time:9446s
shard-snb        total:2585 pass:1258 dwarn:2   dfail:1   fail:13  skip:1311 time:8004s
Blacklisted hosts:
shard-apl        total:2565 pass:1604 dwarn:1   dfail:1   fail:22  skip:936 time:13058s
shard-kbl        total:2565 pass:1700 dwarn:5   dfail:1   fail:25  skip:833 time:10518s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_7166/shards.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: ✓ Fi.CI.IGT: success for drm/i915/selftests: Report ENOMEM clearly for an allocation failure
  2017-11-17 11:56 ` ✓ Fi.CI.IGT: success for " Patchwork
@ 2017-11-17 12:35   ` Chris Wilson
  0 siblings, 0 replies; 8+ messages in thread
From: Chris Wilson @ 2017-11-17 12:35 UTC (permalink / raw)
  To: Patchwork; +Cc: intel-gfx

Quoting Patchwork (2017-11-17 11:56:31)
> == Series Details ==
> 
> Series: drm/i915/selftests: Report ENOMEM clearly for an allocation failure
> URL   : https://patchwork.freedesktop.org/series/33994/
> State : success
> 
> == Logs ==
> 
> For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_7166/shards.html

So still failing to explain live_gtt/igt_ggtt_drunk. :|
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] drm/i915/selftests: Report ENOMEM clearly for an allocation failure
  2017-11-17 15:31 [PATCH] " Chris Wilson
  2017-11-17 16:01 ` Matthew Auld
@ 2017-11-17 16:17 ` Matthew Auld
  1 sibling, 0 replies; 8+ messages in thread
From: Matthew Auld @ 2017-11-17 16:17 UTC (permalink / raw)
  To: Chris Wilson; +Cc: Intel Graphics Development, Matthew Auld

On 17 November 2017 at 15:31, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> If we can not run the drunk_hole test because we couldn't allocate the
> memory for the permutation array (even after we tried trimming the
> size), report a clear ENOMEM. Similary, if we are asked to operate on a
> hole too small for ourselves, make it skip quietly.
>
> v2: Avoid malloc(0) since that returns ZERO_SIZE_PTR not NULL.
> v3: Fixup similar construction for lowlevel_hole
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Matthew Auld <matthew.auld@intel.com>
> Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
> Link: https://patchwork.freedesktop.org/patch/msgid/20171117101732.4335-1-chris@chris-wilson.co.uk
> Reviewed-by: Matthew Auld <matthew.auld@intel.com> #v1
> ---
>  drivers/gpu/drm/i915/selftests/i915_gem_gtt.c | 36 +++++++++++++++++++--------
>  1 file changed, 26 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c b/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
> index 3dcf886a2802..ca83c51b8cac 100644
> --- a/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
> +++ b/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
> @@ -216,13 +216,21 @@ static int lowlevel_hole(struct drm_i915_private *i915,
>                 hole_size = (hole_end - hole_start) >> size;
>                 if (hole_size > KMALLOC_MAX_SIZE / sizeof(u32))
>                         hole_size = KMALLOC_MAX_SIZE / sizeof(u32);
> -               count = hole_size;
> +               count = hole_size / 2;
Oh wait, we need div_u64(), or maybe just hole_size >> 1...
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] drm/i915/selftests: Report ENOMEM clearly for an allocation failure
  2017-11-17 15:31 [PATCH] " Chris Wilson
@ 2017-11-17 16:01 ` Matthew Auld
  2017-11-17 16:17 ` Matthew Auld
  1 sibling, 0 replies; 8+ messages in thread
From: Matthew Auld @ 2017-11-17 16:01 UTC (permalink / raw)
  To: Chris Wilson; +Cc: Intel Graphics Development, Matthew Auld

On 17 November 2017 at 15:31, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> If we can not run the drunk_hole test because we couldn't allocate the
> memory for the permutation array (even after we tried trimming the
> size), report a clear ENOMEM. Similary, if we are asked to operate on a
> hole too small for ourselves, make it skip quietly.
>
> v2: Avoid malloc(0) since that returns ZERO_SIZE_PTR not NULL.
> v3: Fixup similar construction for lowlevel_hole
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Matthew Auld <matthew.auld@intel.com>
> Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
> Link: https://patchwork.freedesktop.org/patch/msgid/20171117101732.4335-1-chris@chris-wilson.co.uk
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH] drm/i915/selftests: Report ENOMEM clearly for an allocation failure
@ 2017-11-17 15:31 Chris Wilson
  2017-11-17 16:01 ` Matthew Auld
  2017-11-17 16:17 ` Matthew Auld
  0 siblings, 2 replies; 8+ messages in thread
From: Chris Wilson @ 2017-11-17 15:31 UTC (permalink / raw)
  To: intel-gfx; +Cc: Matthew Auld

If we can not run the drunk_hole test because we couldn't allocate the
memory for the permutation array (even after we tried trimming the
size), report a clear ENOMEM. Similary, if we are asked to operate on a
hole too small for ourselves, make it skip quietly.

v2: Avoid malloc(0) since that returns ZERO_SIZE_PTR not NULL.
v3: Fixup similar construction for lowlevel_hole

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Matthew Auld <matthew.auld@intel.com>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20171117101732.4335-1-chris@chris-wilson.co.uk
Reviewed-by: Matthew Auld <matthew.auld@intel.com> #v1
---
 drivers/gpu/drm/i915/selftests/i915_gem_gtt.c | 36 +++++++++++++++++++--------
 1 file changed, 26 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c b/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
index 3dcf886a2802..ca83c51b8cac 100644
--- a/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
+++ b/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
@@ -216,13 +216,21 @@ static int lowlevel_hole(struct drm_i915_private *i915,
 		hole_size = (hole_end - hole_start) >> size;
 		if (hole_size > KMALLOC_MAX_SIZE / sizeof(u32))
 			hole_size = KMALLOC_MAX_SIZE / sizeof(u32);
-		count = hole_size;
+		count = hole_size / 2;
+		if (!count) {
+			pr_debug("%s: hole is too small [%llx - %llx] >> %d: %lld\n",
+				 __func__, hole_start, hole_end, size, hole_size);
+			break;
+		}
+
 		do {
-			count >>= 1;
 			order = i915_random_order(count, &prng);
-		} while (!order && count);
-		if (!order)
-			break;
+			if (order)
+				break;
+		} while (count >>= 1);
+		if (!count)
+			return -ENOMEM;
+		GEM_BUG_ON(!order);
 
 		GEM_BUG_ON(count * BIT_ULL(size) > vm->total);
 		GEM_BUG_ON(hole_start + count * BIT_ULL(size) > hole_end);
@@ -704,13 +712,21 @@ static int drunk_hole(struct drm_i915_private *i915,
 		hole_size = (hole_end - hole_start) >> size;
 		if (hole_size > KMALLOC_MAX_SIZE / sizeof(u32))
 			hole_size = KMALLOC_MAX_SIZE / sizeof(u32);
-		count = hole_size;
+		count = hole_size / 2;
+		if (!count) {
+			pr_debug("%s: hole is too small [%llx - %llx] >> %d: %lld\n",
+				 __func__, hole_start, hole_end, size, hole_size);
+			break;
+		}
+
 		do {
-			count >>= 1;
 			order = i915_random_order(count, &prng);
-		} while (!order && count);
-		if (!order)
-			break;
+			if (order)
+				break;
+		} while (count >>= 1);
+		if (!count)
+			return -ENOMEM;
+		GEM_BUG_ON(!order);
 
 		/* Ignore allocation failures (i.e. don't report them as
 		 * a test failure) as we are purposefully allocating very
-- 
2.15.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-11-17 16:18 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-17 10:17 [PATCH] drm/i915/selftests: Report ENOMEM clearly for an allocation failure Chris Wilson
2017-11-17 10:40 ` ✓ Fi.CI.BAT: success for " Patchwork
2017-11-17 11:09 ` [PATCH] " Matthew Auld
2017-11-17 11:56 ` ✓ Fi.CI.IGT: success for " Patchwork
2017-11-17 12:35   ` Chris Wilson
2017-11-17 15:31 [PATCH] " Chris Wilson
2017-11-17 16:01 ` Matthew Auld
2017-11-17 16:17 ` Matthew Auld

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.