All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Handle recursive shrinker for vma->last_active allocation
@ 2018-07-19  7:22 Chris Wilson
  2018-07-19  8:08 ` ✗ Fi.CI.BAT: failure for " Patchwork
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Chris Wilson @ 2018-07-19  7:22 UTC (permalink / raw)
  To: intel-gfx

If we call into the shrinker for direct relcaim inside kmalloc, it will
retire the requests. If we retire the vma->last_active while a new
i915_vma_move_to_active() we can upset the delicate bookkeeping required
for the cache. After the possible invocation of the shrinker, we need to
double check the vma->last_active is still valid.

Fixes: 8b293eb53a7d ("drm/i915: Track the last-active inside the i915_vma")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 drivers/gpu/drm/i915/i915_vma.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_vma.c b/drivers/gpu/drm/i915/i915_vma.c
index ed4e0fb558f7..11d834f94220 100644
--- a/drivers/gpu/drm/i915/i915_vma.c
+++ b/drivers/gpu/drm/i915/i915_vma.c
@@ -942,6 +942,14 @@ static struct i915_gem_active *active_instance(struct i915_vma *vma, u64 idx)
 	}
 
 	active = kmalloc(sizeof(*active), GFP_KERNEL);
+
+	/* kmalloc may retire the vma->last_active request (thanks shrinker)! */
+	if (unlikely(!i915_gem_active_raw(&vma->last_active,
+					  &vma->vm->i915->drm.struct_mutex))) {
+		kfree(active);
+		goto out;
+	}
+
 	if (unlikely(!active))
 		return ERR_PTR(-ENOMEM);
 
-- 
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] 6+ messages in thread

* ✗ Fi.CI.BAT: failure for drm/i915: Handle recursive shrinker for vma->last_active allocation
  2018-07-19  7:22 [PATCH] drm/i915: Handle recursive shrinker for vma->last_active allocation Chris Wilson
@ 2018-07-19  8:08 ` Patchwork
  2018-07-19  9:01 ` ✓ Fi.CI.BAT: success " Patchwork
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Patchwork @ 2018-07-19  8:08 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: Handle recursive shrinker for vma->last_active allocation
URL   : https://patchwork.freedesktop.org/series/46836/
State : failure

== Summary ==

= CI Bug Log - changes from CI_DRM_4507 -> Patchwork_9712 =

== Summary - FAILURE ==

  Serious unknown changes coming with Patchwork_9712 absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in Patchwork_9712, 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/46836/revisions/1/mbox/

== Possible new issues ==

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

  === IGT changes ===

    ==== Possible regressions ====

    igt@drv_selftest@live_hangcheck:
      fi-skl-6260u:       PASS -> DMESG-FAIL

    igt@drv_selftest@live_workarounds:
      fi-bsw-n3050:       PASS -> DMESG-FAIL

    igt@kms_flip@basic-flip-vs-dpms:
      {fi-cfl-8109u}:     NOTRUN -> INCOMPLETE

    
    ==== Warnings ====

    igt@drv_selftest@live_guc:
      fi-skl-6260u:       PASS -> SKIP +1

    
== Known issues ==

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

  === IGT changes ===

    ==== Possible fixes ====

    igt@debugfs_test@read_all_entries:
      fi-snb-2520m:       INCOMPLETE (fdo#103713) -> PASS

    igt@drv_selftest@live_hangcheck:
      fi-skl-6700k2:      DMESG-FAIL (fdo#106560, fdo#107174) -> PASS

    igt@gem_exec_suspend@basic-s3:
      {fi-cfl-8109u}:     INCOMPLETE (fdo#107187) -> PASS

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

  fdo#103713 https://bugs.freedesktop.org/show_bug.cgi?id=103713
  fdo#106560 https://bugs.freedesktop.org/show_bug.cgi?id=106560
  fdo#107174 https://bugs.freedesktop.org/show_bug.cgi?id=107174
  fdo#107187 https://bugs.freedesktop.org/show_bug.cgi?id=107187


== Participating hosts (46 -> 42) ==

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


== Build changes ==

    * Linux: CI_DRM_4507 -> Patchwork_9712

  CI_DRM_4507: 3bbfaebaf3ba21d866c7823d9e4febf47b4b7b39 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_4566: 7270e39a0e6238804827ea7f8db433ad743ed745 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_9712: 74b360109ee2b29540cabc4011dd8472b42a0e22 @ git://anongit.freedesktop.org/gfx-ci/linux


== Linux commits ==

74b360109ee2 drm/i915: Handle recursive shrinker for vma->last_active allocation

== Logs ==

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

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

* ✓ Fi.CI.BAT: success for drm/i915: Handle recursive shrinker for vma->last_active allocation
  2018-07-19  7:22 [PATCH] drm/i915: Handle recursive shrinker for vma->last_active allocation Chris Wilson
  2018-07-19  8:08 ` ✗ Fi.CI.BAT: failure for " Patchwork
@ 2018-07-19  9:01 ` Patchwork
  2018-07-19  9:51 ` ✓ Fi.CI.IGT: " Patchwork
  2018-07-19 11:18 ` [PATCH] " Tvrtko Ursulin
  3 siblings, 0 replies; 6+ messages in thread
From: Patchwork @ 2018-07-19  9:01 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: Handle recursive shrinker for vma->last_active allocation
URL   : https://patchwork.freedesktop.org/series/46836/
State : success

== Summary ==

= CI Bug Log - changes from CI_DRM_4507 -> Patchwork_9714 =

== Summary - WARNING ==

  Minor unknown changes coming with Patchwork_9714 need to be verified
  manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in Patchwork_9714, 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/46836/revisions/1/mbox/

== Possible new issues ==

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

  === IGT changes ===

    ==== Warnings ====

    igt@gem_exec_gttfill@basic:
      fi-pnv-d510:        SKIP -> PASS

    
== Known issues ==

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

  === IGT changes ===

    ==== Issues hit ====

    igt@drv_selftest@live_hangcheck:
      fi-skl-guc:         PASS -> DMESG-FAIL (fdo#107174)

    igt@gem_mmap_gtt@basic-copy:
      {fi-kbl-8809g}:     NOTRUN -> DMESG-WARN (fdo#107222)

    igt@gem_mmap_gtt@basic-write-no-prefault:
      {fi-kbl-8809g}:     NOTRUN -> DMESG-WARN (fdo#107221) +6

    igt@gem_ringfill@basic-default-hang:
      {fi-kbl-8809g}:     NOTRUN -> DMESG-WARN (fdo#107221, fdo#107222)

    
    ==== Possible fixes ====

    igt@drv_selftest@live_hangcheck:
      fi-skl-6700k2:      DMESG-FAIL (fdo#107174, fdo#106560) -> PASS

    igt@gem_exec_suspend@basic-s3:
      {fi-cfl-8109u}:     INCOMPLETE (fdo#107187) -> PASS

    
    ==== Warnings ====

    igt@gem_exec_suspend@basic-s4-devices:
      {fi-kbl-8809g}:     INCOMPLETE (fdo#107139, fdo#103665) -> DMESG-WARN (fdo#107139)

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

  fdo#103665 https://bugs.freedesktop.org/show_bug.cgi?id=103665
  fdo#106560 https://bugs.freedesktop.org/show_bug.cgi?id=106560
  fdo#107139 https://bugs.freedesktop.org/show_bug.cgi?id=107139
  fdo#107174 https://bugs.freedesktop.org/show_bug.cgi?id=107174
  fdo#107187 https://bugs.freedesktop.org/show_bug.cgi?id=107187
  fdo#107221 https://bugs.freedesktop.org/show_bug.cgi?id=107221
  fdo#107222 https://bugs.freedesktop.org/show_bug.cgi?id=107222


== Participating hosts (46 -> 42) ==

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


== Build changes ==

    * Linux: CI_DRM_4507 -> Patchwork_9714

  CI_DRM_4507: 3bbfaebaf3ba21d866c7823d9e4febf47b4b7b39 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_4566: 7270e39a0e6238804827ea7f8db433ad743ed745 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_9714: c348664dd8d0eda603c195a6313b7cea72238cb4 @ git://anongit.freedesktop.org/gfx-ci/linux


== Linux commits ==

c348664dd8d0 drm/i915: Handle recursive shrinker for vma->last_active allocation

== Logs ==

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

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

* ✓ Fi.CI.IGT: success for drm/i915: Handle recursive shrinker for vma->last_active allocation
  2018-07-19  7:22 [PATCH] drm/i915: Handle recursive shrinker for vma->last_active allocation Chris Wilson
  2018-07-19  8:08 ` ✗ Fi.CI.BAT: failure for " Patchwork
  2018-07-19  9:01 ` ✓ Fi.CI.BAT: success " Patchwork
@ 2018-07-19  9:51 ` Patchwork
  2018-07-19 11:18 ` [PATCH] " Tvrtko Ursulin
  3 siblings, 0 replies; 6+ messages in thread
From: Patchwork @ 2018-07-19  9:51 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: Handle recursive shrinker for vma->last_active allocation
URL   : https://patchwork.freedesktop.org/series/46836/
State : success

== Summary ==

= CI Bug Log - changes from CI_DRM_4507_full -> Patchwork_9714_full =

== Summary - WARNING ==

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

  

== Possible new issues ==

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

  === IGT changes ===

    ==== Warnings ====

    igt@gem_exec_schedule@deep-bsd2:
      shard-kbl:          SKIP -> PASS

    igt@gem_exec_schedule@deep-vebox:
      shard-kbl:          PASS -> SKIP

    
== Known issues ==

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

  === IGT changes ===

    ==== Issues hit ====

    igt@kms_flip@flip-vs-expired-vblank:
      shard-glk:          PASS -> FAIL (fdo#102887)

    
    ==== Possible fixes ====

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

    igt@kms_setmode@basic:
      shard-kbl:          FAIL (fdo#99912) -> PASS

    
  fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
  fdo#102887 https://bugs.freedesktop.org/show_bug.cgi?id=102887
  fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912


== Participating hosts (5 -> 5) ==

  No changes in participating hosts


== Build changes ==

    * Linux: CI_DRM_4507 -> Patchwork_9714

  CI_DRM_4507: 3bbfaebaf3ba21d866c7823d9e4febf47b4b7b39 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_4566: 7270e39a0e6238804827ea7f8db433ad743ed745 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_9714: c348664dd8d0eda603c195a6313b7cea72238cb4 @ 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_9714/shards.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH] drm/i915: Handle recursive shrinker for vma->last_active allocation
  2018-07-19  7:22 [PATCH] drm/i915: Handle recursive shrinker for vma->last_active allocation Chris Wilson
                   ` (2 preceding siblings ...)
  2018-07-19  9:51 ` ✓ Fi.CI.IGT: " Patchwork
@ 2018-07-19 11:18 ` Tvrtko Ursulin
  2018-07-19 11:36   ` Chris Wilson
  3 siblings, 1 reply; 6+ messages in thread
From: Tvrtko Ursulin @ 2018-07-19 11:18 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx


On 19/07/2018 08:22, Chris Wilson wrote:
> If we call into the shrinker for direct relcaim inside kmalloc, it will
> retire the requests. If we retire the vma->last_active while a new
> i915_vma_move_to_active() we can upset the delicate bookkeeping required
> for the cache. After the possible invocation of the shrinker, we need to
> double check the vma->last_active is still valid.
> 
> Fixes: 8b293eb53a7d ("drm/i915: Track the last-active inside the i915_vma")
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> ---
>   drivers/gpu/drm/i915/i915_vma.c | 8 ++++++++
>   1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/i915_vma.c b/drivers/gpu/drm/i915/i915_vma.c
> index ed4e0fb558f7..11d834f94220 100644
> --- a/drivers/gpu/drm/i915/i915_vma.c
> +++ b/drivers/gpu/drm/i915/i915_vma.c
> @@ -942,6 +942,14 @@ static struct i915_gem_active *active_instance(struct i915_vma *vma, u64 idx)
>   	}
>   
>   	active = kmalloc(sizeof(*active), GFP_KERNEL);
> +
> +	/* kmalloc may retire the vma->last_active request (thanks shrinker)! */
> +	if (unlikely(!i915_gem_active_raw(&vma->last_active,
> +					  &vma->vm->i915->drm.struct_mutex))) {
> +		kfree(active);
> +		goto out;
> +	}
> +
>   	if (unlikely(!active))
>   		return ERR_PTR(-ENOMEM);
>   
> 

Fun!

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Regards,

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

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

* Re: [PATCH] drm/i915: Handle recursive shrinker for vma->last_active allocation
  2018-07-19 11:18 ` [PATCH] " Tvrtko Ursulin
@ 2018-07-19 11:36   ` Chris Wilson
  0 siblings, 0 replies; 6+ messages in thread
From: Chris Wilson @ 2018-07-19 11:36 UTC (permalink / raw)
  To: Tvrtko Ursulin, intel-gfx

Quoting Tvrtko Ursulin (2018-07-19 12:18:26)
> 
> On 19/07/2018 08:22, Chris Wilson wrote:
> > If we call into the shrinker for direct relcaim inside kmalloc, it will
> > retire the requests. If we retire the vma->last_active while a new
> > i915_vma_move_to_active() we can upset the delicate bookkeeping required
> > for the cache. After the possible invocation of the shrinker, we need to
> > double check the vma->last_active is still valid.
> > 
> > Fixes: 8b293eb53a7d ("drm/i915: Track the last-active inside the i915_vma")
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> > ---
> >   drivers/gpu/drm/i915/i915_vma.c | 8 ++++++++
> >   1 file changed, 8 insertions(+)
> > 
> > diff --git a/drivers/gpu/drm/i915/i915_vma.c b/drivers/gpu/drm/i915/i915_vma.c
> > index ed4e0fb558f7..11d834f94220 100644
> > --- a/drivers/gpu/drm/i915/i915_vma.c
> > +++ b/drivers/gpu/drm/i915/i915_vma.c
> > @@ -942,6 +942,14 @@ static struct i915_gem_active *active_instance(struct i915_vma *vma, u64 idx)
> >       }
> >   
> >       active = kmalloc(sizeof(*active), GFP_KERNEL);
> > +
> > +     /* kmalloc may retire the vma->last_active request (thanks shrinker)! */
> > +     if (unlikely(!i915_gem_active_raw(&vma->last_active,
> > +                                       &vma->vm->i915->drm.struct_mutex))) {
> > +             kfree(active);
> > +             goto out;
> > +     }
> > +
> >       if (unlikely(!active))
> >               return ERR_PTR(-ENOMEM);
> >   
> > 
> 
> Fun!
> 
> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Pushed to keep CI ticking over.
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

end of thread, other threads:[~2018-07-19 11:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-19  7:22 [PATCH] drm/i915: Handle recursive shrinker for vma->last_active allocation Chris Wilson
2018-07-19  8:08 ` ✗ Fi.CI.BAT: failure for " Patchwork
2018-07-19  9:01 ` ✓ Fi.CI.BAT: success " Patchwork
2018-07-19  9:51 ` ✓ Fi.CI.IGT: " Patchwork
2018-07-19 11:18 ` [PATCH] " Tvrtko Ursulin
2018-07-19 11:36   ` Chris Wilson

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.