intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Show vma allocator stack when in doubt
@ 2018-06-28  8:26 Chris Wilson
  2018-06-28  8:55 ` ✗ Fi.CI.BAT: failure for " Patchwork
                   ` (7 more replies)
  0 siblings, 8 replies; 11+ messages in thread
From: Chris Wilson @ 2018-06-28  8:26 UTC (permalink / raw)
  To: intel-gfx

At the moment, gem_exec_gttfill fails with a sporadic EBUSY due to us
wanting to unbind a pinned batch. Let's dump who first bound that vma to
see if that helps us identify who still unexpectedly has it pinned.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/i915_vma.c | 45 +++++++++++++++++++++++++++++++--
 1 file changed, 43 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_vma.c b/drivers/gpu/drm/i915/i915_vma.c
index e82aa804cdba..222787106169 100644
--- a/drivers/gpu/drm/i915/i915_vma.c
+++ b/drivers/gpu/drm/i915/i915_vma.c
@@ -21,7 +21,7 @@
  * IN THE SOFTWARE.
  *
  */
- 
+
 #include "i915_vma.h"
 
 #include "i915_drv.h"
@@ -30,6 +30,45 @@
 
 #include <drm/drm_gem.h>
 
+#if defined(CONFIG_DRM_I915_DEBUG_GEM) && defined(CONFIG_DRM_DEBUG_MM)
+
+#include <linux/stackdepot.h>
+
+static void vma_print_allocator(struct i915_vma *vma, const char *reason)
+{
+	unsigned long entries[16];
+	struct stack_trace trace = {
+		.entries = entries,
+		.max_entries = ARRAY_SIZE(entries),
+	};
+	char *buf;
+
+	if (!vma->node.stack) {
+		DRM_DEBUG_DRIVER("vma.node [%08llx + %08llx] %s: unknown owner\n",
+				 vma->node.start, vma->node.size, reason);
+		return;
+	}
+
+	buf = kmalloc(PAGE_SIZE, GFP_KERNEL);
+	if (!buf)
+		return;
+
+	depot_fetch_stack(vma->node.stack, &trace);
+	snprint_stack_trace(buf, PAGE_SIZE, &trace, 0);
+	DRM_DEBUG_DRIVER("vma.node [%08llx + %08llx] %s: inserted at %s\n",
+			 vma->node.start, vma->node.size, reason, buf);
+
+	kfree(buf);
+}
+
+#else
+
+static void vma_print_allocator(struct i915_vma *vma, const char *reason)
+{
+}
+
+#endif
+
 static void
 i915_vma_retire(struct i915_gem_active *active, struct i915_request *rq)
 {
@@ -875,8 +914,10 @@ int i915_vma_unbind(struct i915_vma *vma)
 	}
 	GEM_BUG_ON(i915_vma_is_active(vma));
 
-	if (i915_vma_is_pinned(vma))
+	if (i915_vma_is_pinned(vma)) {
+		vma_print_allocator(vma, "is pinned");
 		return -EBUSY;
+	}
 
 	if (!drm_mm_node_allocated(&vma->node))
 		return 0;
-- 
2.18.0

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

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

* ✗ Fi.CI.BAT: failure for drm/i915: Show vma allocator stack when in doubt
  2018-06-28  8:26 [PATCH] drm/i915: Show vma allocator stack when in doubt Chris Wilson
@ 2018-06-28  8:55 ` Patchwork
  2018-06-28  9:00   ` Chris Wilson
  2018-06-28  9:02 ` [PATCH v2] " Chris Wilson
                   ` (6 subsequent siblings)
  7 siblings, 1 reply; 11+ messages in thread
From: Patchwork @ 2018-06-28  8:55 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: Show vma allocator stack when in doubt
URL   : https://patchwork.freedesktop.org/series/45562/
State : failure

== Summary ==

= CI Bug Log - changes from CI_DRM_4396 -> Patchwork_9460 =

== Summary - FAILURE ==

  Serious unknown changes coming with Patchwork_9460 absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in Patchwork_9460, please notify your bug team to allow them
  to document this new failure mode, which will reduce false positives in CI.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/45562/revisions/1/mbox/

== Possible new issues ==

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

  === IGT changes ===

    ==== Possible regressions ====

    igt@gem_exec_gttfill@basic:
      {fi-kbl-x1275}:     PASS -> DMESG-WARN
      fi-kbl-7500u:       PASS -> DMESG-WARN
      fi-kbl-guc:         PASS -> DMESG-WARN
      fi-skl-6600u:       PASS -> DMESG-WARN
      fi-kbl-7560u:       PASS -> DMESG-WARN
      fi-cfl-s3:          PASS -> DMESG-WARN
      fi-skl-6770hq:      PASS -> DMESG-WARN
      fi-skl-6700k2:      PASS -> DMESG-WARN
      fi-skl-6260u:       PASS -> DMESG-WARN
      fi-kbl-r:           PASS -> DMESG-WARN
      fi-bdw-5557u:       PASS -> DMESG-WARN
      fi-glk-j4005:       PASS -> DMESG-WARN
      fi-kbl-7567u:       PASS -> DMESG-WARN
      fi-skl-guc:         PASS -> DMESG-WARN
      fi-cfl-8700k:       PASS -> DMESG-WARN
      fi-whl-u:           PASS -> DMESG-WARN
      fi-cfl-guc:         PASS -> DMESG-WARN
      fi-bxt-j4205:       PASS -> DMESG-WARN
      fi-skl-6700hq:      PASS -> DMESG-WARN

    
== Known issues ==

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

  === IGT changes ===

    ==== Issues hit ====

    igt@gem_exec_gttfill@basic:
      fi-byt-n2820:       PASS -> FAIL (fdo#106744)

    igt@kms_pipe_crc_basic@suspend-read-crc-pipe-c:
      fi-bxt-dsi:         PASS -> INCOMPLETE (fdo#103927)

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

  fdo#103927 https://bugs.freedesktop.org/show_bug.cgi?id=103927
  fdo#106744 https://bugs.freedesktop.org/show_bug.cgi?id=106744


== Participating hosts (43 -> 38) ==

  Missing    (5): fi-byt-j1900 fi-ctg-p8600 fi-byt-squawks fi-ilk-m540 fi-hsw-4200u 


== Build changes ==

    * Linux: CI_DRM_4396 -> Patchwork_9460

  CI_DRM_4396: dd5f49f9686f412baa426502d417ac74a37fc77e @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_4530: 0e98bf69f146eb72fe3a7c3b19a049b5786f0ca3 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_9460: ddf619ecd8f95acdf401d58a5670956322500a20 @ git://anongit.freedesktop.org/gfx-ci/linux


== Linux commits ==

ddf619ecd8f9 drm/i915: Show vma allocator stack when in doubt

== Logs ==

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

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

* Re: ✗ Fi.CI.BAT: failure for drm/i915: Show vma allocator stack when in doubt
  2018-06-28  8:55 ` ✗ Fi.CI.BAT: failure for " Patchwork
@ 2018-06-28  9:00   ` Chris Wilson
  0 siblings, 0 replies; 11+ messages in thread
From: Chris Wilson @ 2018-06-28  9:00 UTC (permalink / raw)
  To: Patchwork; +Cc: intel-gfx

Quoting Patchwork (2018-06-28 09:55:21)
> == Series Details ==
> 
> Series: drm/i915: Show vma allocator stack when in doubt
> URL   : https://patchwork.freedesktop.org/series/45562/
> State : failure
> 
> == Summary ==
> 
> = CI Bug Log - changes from CI_DRM_4396 -> Patchwork_9460 =
> 
> == Summary - FAILURE ==
> 
>   Serious unknown changes coming with Patchwork_9460 absolutely need to be
>   verified manually.
>   
>   If you think the reported changes have nothing to do with the changes
>   introduced in Patchwork_9460, please notify your bug team to allow them
>   to document this new failure mode, which will reduce false positives in CI.
> 
>   External URL: https://patchwork.freedesktop.org/api/1.0/series/45562/revisions/1/mbox/
> 
> == Possible new issues ==
> 
>   Here are the unknown changes that may have been introduced in Patchwork_9460:
> 
>   === IGT changes ===
> 
>     ==== Possible regressions ====
> 
>     igt@gem_exec_gttfill@basic:
>       {fi-kbl-x1275}:     PASS -> DMESG-WARN
>       fi-kbl-7500u:       PASS -> DMESG-WARN
>       fi-kbl-guc:         PASS -> DMESG-WARN
>       fi-skl-6600u:       PASS -> DMESG-WARN
>       fi-kbl-7560u:       PASS -> DMESG-WARN
>       fi-cfl-s3:          PASS -> DMESG-WARN
>       fi-skl-6770hq:      PASS -> DMESG-WARN
>       fi-skl-6700k2:      PASS -> DMESG-WARN
>       fi-skl-6260u:       PASS -> DMESG-WARN
>       fi-kbl-r:           PASS -> DMESG-WARN
>       fi-bdw-5557u:       PASS -> DMESG-WARN
>       fi-glk-j4005:       PASS -> DMESG-WARN
>       fi-kbl-7567u:       PASS -> DMESG-WARN
>       fi-skl-guc:         PASS -> DMESG-WARN
>       fi-cfl-8700k:       PASS -> DMESG-WARN
>       fi-whl-u:           PASS -> DMESG-WARN
>       fi-cfl-guc:         PASS -> DMESG-WARN
>       fi-bxt-j4205:       PASS -> DMESG-WARN
>       fi-skl-6700hq:      PASS -> DMESG-WARN

Allocation not allowed, hmm. Let's see just how much the stack can take!
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* [PATCH v2] drm/i915: Show vma allocator stack when in doubt
  2018-06-28  8:26 [PATCH] drm/i915: Show vma allocator stack when in doubt Chris Wilson
  2018-06-28  8:55 ` ✗ Fi.CI.BAT: failure for " Patchwork
@ 2018-06-28  9:02 ` Chris Wilson
  2018-06-28  9:33 ` ✓ Fi.CI.BAT: success for drm/i915: Show vma allocator stack when in doubt (rev2) Patchwork
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 11+ messages in thread
From: Chris Wilson @ 2018-06-28  9:02 UTC (permalink / raw)
  To: intel-gfx

At the moment, gem_exec_gttfill fails with a sporadic EBUSY due to us
wanting to unbind a pinned batch. Let's dump who first bound that vma to
see if that helps us identify who still unexpectedly has it pinned.

v2: We cannot allocate inside the printer (as it may be on an fs-reclaim
path), so hope for the best and build the string on the stack

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/i915_vma.c | 39 +++++++++++++++++++++++++++++++--
 1 file changed, 37 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_vma.c b/drivers/gpu/drm/i915/i915_vma.c
index e82aa804cdba..1a9aed773a5b 100644
--- a/drivers/gpu/drm/i915/i915_vma.c
+++ b/drivers/gpu/drm/i915/i915_vma.c
@@ -21,7 +21,7 @@
  * IN THE SOFTWARE.
  *
  */
- 
+
 #include "i915_vma.h"
 
 #include "i915_drv.h"
@@ -30,6 +30,39 @@
 
 #include <drm/drm_gem.h>
 
+#if defined(CONFIG_DRM_I915_DEBUG_GEM) && defined(CONFIG_DRM_DEBUG_MM)
+
+#include <linux/stackdepot.h>
+
+static void vma_print_allocator(struct i915_vma *vma, const char *reason)
+{
+	unsigned long entries[16];
+	struct stack_trace trace = {
+		.entries = entries,
+		.max_entries = ARRAY_SIZE(entries),
+	};
+	char buf[512];
+
+	if (!vma->node.stack) {
+		DRM_DEBUG_DRIVER("vma.node [%08llx + %08llx] %s: unknown owner\n",
+				 vma->node.start, vma->node.size, reason);
+		return;
+	}
+
+	depot_fetch_stack(vma->node.stack, &trace);
+	snprint_stack_trace(buf, sizeof(buf), &trace, 0);
+	DRM_DEBUG_DRIVER("vma.node [%08llx + %08llx] %s: inserted at %s\n",
+			 vma->node.start, vma->node.size, reason, buf);
+}
+
+#else
+
+static void vma_print_allocator(struct i915_vma *vma, const char *reason)
+{
+}
+
+#endif
+
 static void
 i915_vma_retire(struct i915_gem_active *active, struct i915_request *rq)
 {
@@ -875,8 +908,10 @@ int i915_vma_unbind(struct i915_vma *vma)
 	}
 	GEM_BUG_ON(i915_vma_is_active(vma));
 
-	if (i915_vma_is_pinned(vma))
+	if (i915_vma_is_pinned(vma)) {
+		vma_print_allocator(vma, "is pinned");
 		return -EBUSY;
+	}
 
 	if (!drm_mm_node_allocated(&vma->node))
 		return 0;
-- 
2.18.0

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

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

* ✓ Fi.CI.BAT: success for drm/i915: Show vma allocator stack when in doubt (rev2)
  2018-06-28  8:26 [PATCH] drm/i915: Show vma allocator stack when in doubt Chris Wilson
  2018-06-28  8:55 ` ✗ Fi.CI.BAT: failure for " Patchwork
  2018-06-28  9:02 ` [PATCH v2] " Chris Wilson
@ 2018-06-28  9:33 ` Patchwork
  2018-06-28  9:43 ` [PATCH v3] drm/i915: Show vma allocator stack when in doubt Chris Wilson
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 11+ messages in thread
From: Patchwork @ 2018-06-28  9:33 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: Show vma allocator stack when in doubt (rev2)
URL   : https://patchwork.freedesktop.org/series/45562/
State : success

== Summary ==

= CI Bug Log - changes from CI_DRM_4396 -> Patchwork_9461 =

== Summary - SUCCESS ==

  No regressions found.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/45562/revisions/2/mbox/

== Known issues ==

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

  === IGT changes ===

    ==== Issues hit ====

    igt@kms_pipe_crc_basic@suspend-read-crc-pipe-b:
      fi-snb-2520m:       PASS -> INCOMPLETE (fdo#103713)

    igt@prime_vgem@basic-fence-flip:
      fi-ilk-650:         PASS -> FAIL (fdo#104008)

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


== Participating hosts (43 -> 39) ==

  Missing    (4): fi-ctg-p8600 fi-ilk-m540 fi-byt-squawks fi-hsw-4200u 


== Build changes ==

    * Linux: CI_DRM_4396 -> Patchwork_9461

  CI_DRM_4396: dd5f49f9686f412baa426502d417ac74a37fc77e @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_4530: 0e98bf69f146eb72fe3a7c3b19a049b5786f0ca3 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_9461: a729778bbfad9a0da7953fce9da5be9c67fd1741 @ git://anongit.freedesktop.org/gfx-ci/linux


== Linux commits ==

a729778bbfad drm/i915: Show vma allocator stack when in doubt

== Logs ==

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

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

* [PATCH v3] drm/i915: Show vma allocator stack when in doubt
  2018-06-28  8:26 [PATCH] drm/i915: Show vma allocator stack when in doubt Chris Wilson
                   ` (2 preceding siblings ...)
  2018-06-28  9:33 ` ✓ Fi.CI.BAT: success for drm/i915: Show vma allocator stack when in doubt (rev2) Patchwork
@ 2018-06-28  9:43 ` Chris Wilson
  2018-06-28 10:16 ` ✗ Fi.CI.BAT: failure for drm/i915: Show vma allocator stack when in doubt (rev3) Patchwork
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 11+ messages in thread
From: Chris Wilson @ 2018-06-28  9:43 UTC (permalink / raw)
  To: intel-gfx

At the moment, gem_exec_gttfill fails with a sporadic EBUSY due to us
wanting to unbind a pinned batch. Let's dump who first bound that vma to
see if that helps us identify who still unexpectedly has it pinned.

v2: We cannot allocate inside the printer (as it may be on an fs-reclaim
path), so hope for the best and build the string on the stack
v3: stack depth of 16 routinely overflows a 512 character string, limit
it to 12 to avoid unsightly truncation.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/i915_vma.c | 39 +++++++++++++++++++++++++++++++--
 1 file changed, 37 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_vma.c b/drivers/gpu/drm/i915/i915_vma.c
index e82aa804cdba..2b7440568e4d 100644
--- a/drivers/gpu/drm/i915/i915_vma.c
+++ b/drivers/gpu/drm/i915/i915_vma.c
@@ -21,7 +21,7 @@
  * IN THE SOFTWARE.
  *
  */
- 
+
 #include "i915_vma.h"
 
 #include "i915_drv.h"
@@ -30,6 +30,39 @@
 
 #include <drm/drm_gem.h>
 
+#if defined(CONFIG_DRM_I915_DEBUG_GEM) && defined(CONFIG_DRM_DEBUG_MM)
+
+#include <linux/stackdepot.h>
+
+static void vma_print_allocator(struct i915_vma *vma, const char *reason)
+{
+	unsigned long entries[12];
+	struct stack_trace trace = {
+		.entries = entries,
+		.max_entries = ARRAY_SIZE(entries),
+	};
+	char buf[512];
+
+	if (!vma->node.stack) {
+		DRM_DEBUG_DRIVER("vma.node [%08llx + %08llx] %s: unknown owner\n",
+				 vma->node.start, vma->node.size, reason);
+		return;
+	}
+
+	depot_fetch_stack(vma->node.stack, &trace);
+	snprint_stack_trace(buf, sizeof(buf), &trace, 0);
+	DRM_DEBUG_DRIVER("vma.node [%08llx + %08llx] %s: inserted at %s\n",
+			 vma->node.start, vma->node.size, reason, buf);
+}
+
+#else
+
+static void vma_print_allocator(struct i915_vma *vma, const char *reason)
+{
+}
+
+#endif
+
 static void
 i915_vma_retire(struct i915_gem_active *active, struct i915_request *rq)
 {
@@ -875,8 +908,10 @@ int i915_vma_unbind(struct i915_vma *vma)
 	}
 	GEM_BUG_ON(i915_vma_is_active(vma));
 
-	if (i915_vma_is_pinned(vma))
+	if (i915_vma_is_pinned(vma)) {
+		vma_print_allocator(vma, "is pinned");
 		return -EBUSY;
+	}
 
 	if (!drm_mm_node_allocated(&vma->node))
 		return 0;
-- 
2.18.0

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

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

* ✗ Fi.CI.BAT: failure for drm/i915: Show vma allocator stack when in doubt (rev3)
  2018-06-28  8:26 [PATCH] drm/i915: Show vma allocator stack when in doubt Chris Wilson
                   ` (3 preceding siblings ...)
  2018-06-28  9:43 ` [PATCH v3] drm/i915: Show vma allocator stack when in doubt Chris Wilson
@ 2018-06-28 10:16 ` Patchwork
  2018-06-28 13:22 ` [PATCH v4] drm/i915: Show vma allocator stack when in doubt Chris Wilson
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 11+ messages in thread
From: Patchwork @ 2018-06-28 10:16 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: Show vma allocator stack when in doubt (rev3)
URL   : https://patchwork.freedesktop.org/series/45562/
State : failure

== Summary ==

= CI Bug Log - changes from CI_DRM_4396 -> Patchwork_9462 =

== Summary - FAILURE ==

  Serious unknown changes coming with Patchwork_9462 absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in Patchwork_9462, please notify your bug team to allow them
  to document this new failure mode, which will reduce false positives in CI.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/45562/revisions/3/mbox/

== Possible new issues ==

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

  === IGT changes ===

    ==== Possible regressions ====

    igt@kms_pipe_crc_basic@suspend-read-crc-pipe-c:
      fi-skl-6600u:       PASS -> DMESG-WARN +4

    
== Known issues ==

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

  === IGT changes ===

    ==== Issues hit ====

    igt@drv_module_reload@basic-reload:
      fi-skl-6600u:       PASS -> DMESG-WARN (fdo#106697)

    igt@gem_exec_suspend@basic-s4-devices:
      fi-kbl-7500u:       PASS -> DMESG-WARN (fdo#105128)

    
  fdo#105128 https://bugs.freedesktop.org/show_bug.cgi?id=105128
  fdo#106697 https://bugs.freedesktop.org/show_bug.cgi?id=106697


== Participating hosts (43 -> 38) ==

  Missing    (5): fi-ctg-p8600 fi-kbl-7560u fi-byt-squawks fi-ilk-m540 fi-hsw-4200u 


== Build changes ==

    * Linux: CI_DRM_4396 -> Patchwork_9462

  CI_DRM_4396: dd5f49f9686f412baa426502d417ac74a37fc77e @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_4530: 0e98bf69f146eb72fe3a7c3b19a049b5786f0ca3 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_9462: 0baf797439ce8499f92211da1b442b6ca94dd283 @ git://anongit.freedesktop.org/gfx-ci/linux


== Linux commits ==

0baf797439ce drm/i915: Show vma allocator stack when in doubt

== Logs ==

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

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

* [PATCH v4] drm/i915: Show vma allocator stack when in doubt
  2018-06-28  8:26 [PATCH] drm/i915: Show vma allocator stack when in doubt Chris Wilson
                   ` (4 preceding siblings ...)
  2018-06-28 10:16 ` ✗ Fi.CI.BAT: failure for drm/i915: Show vma allocator stack when in doubt (rev3) Patchwork
@ 2018-06-28 13:22 ` Chris Wilson
  2018-06-28 13:42   ` Mika Kuoppala
  2018-06-28 14:09 ` ✓ Fi.CI.BAT: success for drm/i915: Show vma allocator stack when in doubt (rev4) Patchwork
  2018-06-28 16:16 ` ✓ Fi.CI.IGT: " Patchwork
  7 siblings, 1 reply; 11+ messages in thread
From: Chris Wilson @ 2018-06-28 13:22 UTC (permalink / raw)
  To: intel-gfx

At the moment, gem_exec_gttfill fails with a sporadic EBUSY due to us
wanting to unbind a pinned batch. Let's dump who first bound that vma to
see if that helps us identify who still unexpectedly has it pinned.

v2: We cannot allocate inside the printer (as it may be on an fs-reclaim
path), so hope for the best and build the string on the stack
v3: stack depth of 16 routinely overflows a 512 character string, limit
it to 12 to avoid unsightly truncation.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/i915_vma.c | 39 +++++++++++++++++++++++++++++++--
 1 file changed, 37 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_vma.c b/drivers/gpu/drm/i915/i915_vma.c
index e82aa804cdba..d0e606e9b27a 100644
--- a/drivers/gpu/drm/i915/i915_vma.c
+++ b/drivers/gpu/drm/i915/i915_vma.c
@@ -21,7 +21,7 @@
  * IN THE SOFTWARE.
  *
  */
- 
+
 #include "i915_vma.h"
 
 #include "i915_drv.h"
@@ -30,6 +30,39 @@
 
 #include <drm/drm_gem.h>
 
+#if IS_ENABLED(CONFIG_DRM_I915_DEBUG_GEM) && IS_ENABLED(CONFIG_DRM_DEBUG_MM)
+
+#include <linux/stackdepot.h>
+
+static void vma_print_allocator(struct i915_vma *vma, const char *reason)
+{
+	unsigned long entries[12];
+	struct stack_trace trace = {
+		.entries = entries,
+		.max_entries = ARRAY_SIZE(entries),
+	};
+	char buf[512];
+
+	if (!vma->node.stack) {
+		DRM_DEBUG_DRIVER("vma.node [%08llx + %08llx] %s: unknown owner\n",
+				 vma->node.start, vma->node.size, reason);
+		return;
+	}
+
+	depot_fetch_stack(vma->node.stack, &trace);
+	snprint_stack_trace(buf, sizeof(buf), &trace, 0);
+	DRM_DEBUG_DRIVER("vma.node [%08llx + %08llx] %s: inserted at %s\n",
+			 vma->node.start, vma->node.size, reason, buf);
+}
+
+#else
+
+static void vma_print_allocator(struct i915_vma *vma, const char *reason)
+{
+}
+
+#endif
+
 static void
 i915_vma_retire(struct i915_gem_active *active, struct i915_request *rq)
 {
@@ -875,8 +908,10 @@ int i915_vma_unbind(struct i915_vma *vma)
 	}
 	GEM_BUG_ON(i915_vma_is_active(vma));
 
-	if (i915_vma_is_pinned(vma))
+	if (i915_vma_is_pinned(vma)) {
+		vma_print_allocator(vma, "is pinned");
 		return -EBUSY;
+	}
 
 	if (!drm_mm_node_allocated(&vma->node))
 		return 0;
-- 
2.18.0

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

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

* Re: [PATCH v4] drm/i915: Show vma allocator stack when in doubt
  2018-06-28 13:22 ` [PATCH v4] drm/i915: Show vma allocator stack when in doubt Chris Wilson
@ 2018-06-28 13:42   ` Mika Kuoppala
  0 siblings, 0 replies; 11+ messages in thread
From: Mika Kuoppala @ 2018-06-28 13:42 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx

Chris Wilson <chris@chris-wilson.co.uk> writes:

> At the moment, gem_exec_gttfill fails with a sporadic EBUSY due to us
> wanting to unbind a pinned batch. Let's dump who first bound that vma to
> see if that helps us identify who still unexpectedly has it pinned.
>
> v2: We cannot allocate inside the printer (as it may be on an fs-reclaim
> path), so hope for the best and build the string on the stack
> v3: stack depth of 16 routinely overflows a 512 character string, limit
> it to 12 to avoid unsightly truncation.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> ---
>  drivers/gpu/drm/i915/i915_vma.c | 39 +++++++++++++++++++++++++++++++--
>  1 file changed, 37 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_vma.c b/drivers/gpu/drm/i915/i915_vma.c
> index e82aa804cdba..d0e606e9b27a 100644
> --- a/drivers/gpu/drm/i915/i915_vma.c
> +++ b/drivers/gpu/drm/i915/i915_vma.c
> @@ -21,7 +21,7 @@
>   * IN THE SOFTWARE.
>   *
>   */
> - 
> +

Extra spaces we don't carry around.

>  #include "i915_vma.h"
>  
>  #include "i915_drv.h"
> @@ -30,6 +30,39 @@
>  
>  #include <drm/drm_gem.h>
>  
> +#if IS_ENABLED(CONFIG_DRM_I915_DEBUG_GEM) && IS_ENABLED(CONFIG_DRM_DEBUG_MM)
> +
> +#include <linux/stackdepot.h>
> +
> +static void vma_print_allocator(struct i915_vma *vma, const char *reason)
> +{
> +	unsigned long entries[12];

Someone might complain that the array len needs a define.
But it clearly does not need it.

> +	struct stack_trace trace = {
> +		.entries = entries,
> +		.max_entries = ARRAY_SIZE(entries),
> +	};
> +	char buf[512];

Under the umbrella of those two debug defines,
this should be fine. Perhaps even conservative,
but if it gets the job done,

Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>

> +
> +	if (!vma->node.stack) {
> +		DRM_DEBUG_DRIVER("vma.node [%08llx + %08llx] %s: unknown owner\n",
> +				 vma->node.start, vma->node.size, reason);
> +		return;
> +	}
> +
> +	depot_fetch_stack(vma->node.stack, &trace);
> +	snprint_stack_trace(buf, sizeof(buf), &trace, 0);
> +	DRM_DEBUG_DRIVER("vma.node [%08llx + %08llx] %s: inserted at %s\n",
> +			 vma->node.start, vma->node.size, reason, buf);
> +}
> +
> +#else
> +
> +static void vma_print_allocator(struct i915_vma *vma, const char *reason)
> +{
> +}
> +
> +#endif
> +
>  static void
>  i915_vma_retire(struct i915_gem_active *active, struct i915_request *rq)
>  {
> @@ -875,8 +908,10 @@ int i915_vma_unbind(struct i915_vma *vma)
>  	}
>  	GEM_BUG_ON(i915_vma_is_active(vma));
>  
> -	if (i915_vma_is_pinned(vma))
> +	if (i915_vma_is_pinned(vma)) {
> +		vma_print_allocator(vma, "is pinned");
>  		return -EBUSY;
> +	}
>  
>  	if (!drm_mm_node_allocated(&vma->node))
>  		return 0;
> -- 
> 2.18.0
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* ✓ Fi.CI.BAT: success for drm/i915: Show vma allocator stack when in doubt (rev4)
  2018-06-28  8:26 [PATCH] drm/i915: Show vma allocator stack when in doubt Chris Wilson
                   ` (5 preceding siblings ...)
  2018-06-28 13:22 ` [PATCH v4] drm/i915: Show vma allocator stack when in doubt Chris Wilson
@ 2018-06-28 14:09 ` Patchwork
  2018-06-28 16:16 ` ✓ Fi.CI.IGT: " Patchwork
  7 siblings, 0 replies; 11+ messages in thread
From: Patchwork @ 2018-06-28 14:09 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: Show vma allocator stack when in doubt (rev4)
URL   : https://patchwork.freedesktop.org/series/45562/
State : success

== Summary ==

= CI Bug Log - changes from CI_DRM_4397 -> Patchwork_9470 =

== Summary - SUCCESS ==

  No regressions found.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/45562/revisions/4/mbox/

== Known issues ==

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

  === IGT changes ===

    ==== Issues hit ====

    igt@kms_chamelium@dp-crc-fast:
      fi-kbl-7500u:       PASS -> DMESG-FAIL (fdo#103841)

    igt@prime_vgem@basic-fence-flip:
      fi-ilk-650:         PASS -> FAIL (fdo#104008)

    
  fdo#103841 https://bugs.freedesktop.org/show_bug.cgi?id=103841
  fdo#104008 https://bugs.freedesktop.org/show_bug.cgi?id=104008


== Participating hosts (44 -> 39) ==

  Missing    (5): fi-ctg-p8600 fi-ilk-m540 fi-byt-squawks fi-bsw-cyan fi-hsw-4200u 


== Build changes ==

    * Linux: CI_DRM_4397 -> Patchwork_9470

  CI_DRM_4397: 7306233935b0e426454e8adcf09a8022faa03cbc @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_4530: 0e98bf69f146eb72fe3a7c3b19a049b5786f0ca3 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_9470: 41116ddd6b73c10a63409baea4d9a435221b4754 @ git://anongit.freedesktop.org/gfx-ci/linux


== Linux commits ==

41116ddd6b73 drm/i915: Show vma allocator stack when in doubt

== Logs ==

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

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

* ✓ Fi.CI.IGT: success for drm/i915: Show vma allocator stack when in doubt (rev4)
  2018-06-28  8:26 [PATCH] drm/i915: Show vma allocator stack when in doubt Chris Wilson
                   ` (6 preceding siblings ...)
  2018-06-28 14:09 ` ✓ Fi.CI.BAT: success for drm/i915: Show vma allocator stack when in doubt (rev4) Patchwork
@ 2018-06-28 16:16 ` Patchwork
  7 siblings, 0 replies; 11+ messages in thread
From: Patchwork @ 2018-06-28 16:16 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: Show vma allocator stack when in doubt (rev4)
URL   : https://patchwork.freedesktop.org/series/45562/
State : success

== Summary ==

= CI Bug Log - changes from CI_DRM_4397_full -> Patchwork_9470_full =

== Summary - SUCCESS ==

  No regressions found.

  

== Known issues ==

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

  === IGT changes ===

    ==== Issues hit ====

    igt@drv_selftest@live_hangcheck:
      shard-kbl:          PASS -> DMESG-FAIL (fdo#106947, fdo#106560)
      shard-apl:          PASS -> DMESG-FAIL (fdo#106947, fdo#106560)

    igt@drv_suspend@shrink:
      shard-snb:          PASS -> FAIL (fdo#106886)

    igt@gem_mmap_gtt@coherency:
      shard-glk:          NOTRUN -> FAIL (fdo#100587)

    igt@kms_available_modes_crc@available_mode_test_crc:
      {shard-glk9}:       NOTRUN -> FAIL (fdo#106641)

    igt@kms_flip@2x-flip-vs-expired-vblank:
      {shard-glk9}:       NOTRUN -> FAIL (fdo#105363)

    igt@kms_flip@2x-plain-flip-fb-recreate-interruptible:
      shard-glk:          NOTRUN -> FAIL (fdo#100368)

    igt@perf_pmu@busy-accuracy-98-vcs1:
      shard-snb:          NOTRUN -> INCOMPLETE (fdo#105411)

    
    ==== Possible fixes ====

    igt@gem_exec_schedule@preemptive-hang-render:
      shard-snb:          INCOMPLETE (fdo#105411) -> SKIP

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

  fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
  fdo#100587 https://bugs.freedesktop.org/show_bug.cgi?id=100587
  fdo#105363 https://bugs.freedesktop.org/show_bug.cgi?id=105363
  fdo#105411 https://bugs.freedesktop.org/show_bug.cgi?id=105411
  fdo#106560 https://bugs.freedesktop.org/show_bug.cgi?id=106560
  fdo#106641 https://bugs.freedesktop.org/show_bug.cgi?id=106641
  fdo#106886 https://bugs.freedesktop.org/show_bug.cgi?id=106886
  fdo#106947 https://bugs.freedesktop.org/show_bug.cgi?id=106947


== Participating hosts (6 -> 6) ==

  No changes in participating hosts


== Build changes ==

    * Linux: CI_DRM_4397 -> Patchwork_9470

  CI_DRM_4397: 7306233935b0e426454e8adcf09a8022faa03cbc @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_4530: 0e98bf69f146eb72fe3a7c3b19a049b5786f0ca3 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_9470: 41116ddd6b73c10a63409baea4d9a435221b4754 @ 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_9470/shards.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

end of thread, other threads:[~2018-06-28 16:16 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-28  8:26 [PATCH] drm/i915: Show vma allocator stack when in doubt Chris Wilson
2018-06-28  8:55 ` ✗ Fi.CI.BAT: failure for " Patchwork
2018-06-28  9:00   ` Chris Wilson
2018-06-28  9:02 ` [PATCH v2] " Chris Wilson
2018-06-28  9:33 ` ✓ Fi.CI.BAT: success for drm/i915: Show vma allocator stack when in doubt (rev2) Patchwork
2018-06-28  9:43 ` [PATCH v3] drm/i915: Show vma allocator stack when in doubt Chris Wilson
2018-06-28 10:16 ` ✗ Fi.CI.BAT: failure for drm/i915: Show vma allocator stack when in doubt (rev3) Patchwork
2018-06-28 13:22 ` [PATCH v4] drm/i915: Show vma allocator stack when in doubt Chris Wilson
2018-06-28 13:42   ` Mika Kuoppala
2018-06-28 14:09 ` ✓ Fi.CI.BAT: success for drm/i915: Show vma allocator stack when in doubt (rev4) Patchwork
2018-06-28 16:16 ` ✓ Fi.CI.IGT: " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).