public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Handle ENOSPC after failing to insert a mappable node
@ 2016-07-16 17:42 Chris Wilson
  2016-07-17  5:22 ` ✗ Ro.CI.BAT: failure for " Patchwork
  2016-07-19  6:55 ` [PATCH] " Daniel Vetter
  0 siblings, 2 replies; 6+ messages in thread
From: Chris Wilson @ 2016-07-16 17:42 UTC (permalink / raw)
  To: intel-gfx; +Cc: Ankitprasad Sharma

Even after adding individual page support for GTT mmaping, we can still
fail to find any space within the mappable region, and
drm_mm_insert_node() will then report ENOSPC. We have to then handle
this error by using the shmem access to the pages.

Fixes: b50a53715f09 ("drm/i915: Support for pread/pwrite ... objects")
Testcase: igt/gem_concurrent_blit
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Ankitprasad Sharma <ankitprasad.r.sharma@intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com
---
 drivers/gpu/drm/i915/i915_gem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 4644a7e67cf6..e37f73d3965c 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -1306,7 +1306,7 @@ i915_gem_pwrite_ioctl(struct drm_device *dev, void *data,
 		 * textures). Fallback to the shmem path in that case. */
 	}
 
-	if (ret == -EFAULT) {
+	if (ret == -EFAULT || ret == -ENOSPC) {
 		if (obj->phys_handle)
 			ret = i915_gem_phys_pwrite(obj, args, file);
 		else if (i915_gem_object_has_struct_page(obj))
-- 
2.8.1

_______________________________________________
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

* ✗ Ro.CI.BAT: failure for drm/i915: Handle ENOSPC after failing to insert a mappable node
  2016-07-16 17:42 [PATCH] drm/i915: Handle ENOSPC after failing to insert a mappable node Chris Wilson
@ 2016-07-17  5:22 ` Patchwork
  2016-07-19  6:55 ` [PATCH] " Daniel Vetter
  1 sibling, 0 replies; 6+ messages in thread
From: Patchwork @ 2016-07-17  5:22 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: Handle ENOSPC after failing to insert a mappable node
URL   : https://patchwork.freedesktop.org/series/9952/
State : failure

== Summary ==

Series 9952v1 drm/i915: Handle ENOSPC after failing to insert a mappable node
http://patchwork.freedesktop.org/api/1.0/series/9952/revisions/1/mbox

Test gem_exec_suspend:
        Subgroup basic-s3:
                pass       -> INCOMPLETE (fi-skl-i7-6700k)
Test gem_sync:
        Subgroup basic-store-each:
                dmesg-fail -> PASS       (ro-bdw-i7-5600u)
Test kms_flip:
        Subgroup basic-flip-vs-wf_vblank:
                pass       -> FAIL       (ro-hsw-i7-4770r)

fi-hsw-i7-4770k  total:242  pass:210  dwarn:0   dfail:0   fail:8   skip:24 
fi-kbl-qkkr      total:242  pass:175  dwarn:29  dfail:0   fail:7   skip:31 
fi-skl-i5-6260u  total:242  pass:219  dwarn:0   dfail:0   fail:7   skip:16 
fi-skl-i7-6700k  total:107  pass:84   dwarn:0   dfail:0   fail:0   skip:22 
fi-snb-i7-2600   total:242  pass:190  dwarn:0   dfail:0   fail:8   skip:44 
ro-bdw-i5-5250u  total:242  pass:214  dwarn:4   dfail:0   fail:7   skip:17 
ro-bdw-i7-5557U  total:242  pass:215  dwarn:0   dfail:0   fail:7   skip:20 
ro-bdw-i7-5600u  total:242  pass:200  dwarn:0   dfail:0   fail:7   skip:35 
ro-bsw-n3050     total:218  pass:173  dwarn:0   dfail:0   fail:2   skip:42 
ro-byt-n2820     total:242  pass:191  dwarn:0   dfail:0   fail:9   skip:42 
ro-hsw-i3-4010u  total:242  pass:206  dwarn:0   dfail:0   fail:8   skip:28 
ro-hsw-i7-4770r  total:242  pass:205  dwarn:0   dfail:0   fail:9   skip:28 
ro-ilk-i7-620lm  total:242  pass:166  dwarn:0   dfail:0   fail:9   skip:67 
ro-ilk1-i5-650   total:237  pass:166  dwarn:0   dfail:0   fail:9   skip:62 
ro-ivb-i7-3770   total:242  pass:197  dwarn:0   dfail:0   fail:8   skip:37 
ro-skl3-i5-6260u total:242  pass:218  dwarn:1   dfail:0   fail:7   skip:16 
ro-snb-i7-2620M  total:242  pass:188  dwarn:0   dfail:0   fail:9   skip:45 
fi-bsw-n3050 failed to connect after reboot

Results at /archive/results/CI_IGT_test/RO_Patchwork_1512/

2fe098f drm-intel-nightly: 2016y-07m-15d-19h-42m-01s UTC integration manifest
7ee5e56 drm/i915: Handle ENOSPC after failing to insert a mappable node

_______________________________________________
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 ENOSPC after failing to insert a mappable node
  2016-07-16 17:42 [PATCH] drm/i915: Handle ENOSPC after failing to insert a mappable node Chris Wilson
  2016-07-17  5:22 ` ✗ Ro.CI.BAT: failure for " Patchwork
@ 2016-07-19  6:55 ` Daniel Vetter
  2016-07-19  7:09   ` Chris Wilson
  2016-07-19  8:28   ` Chris Wilson
  1 sibling, 2 replies; 6+ messages in thread
From: Daniel Vetter @ 2016-07-19  6:55 UTC (permalink / raw)
  To: Chris Wilson; +Cc: Ankitprasad Sharma, intel-gfx

On Sat, Jul 16, 2016 at 06:42:36PM +0100, Chris Wilson wrote:
> Even after adding individual page support for GTT mmaping, we can still
> fail to find any space within the mappable region, and
> drm_mm_insert_node() will then report ENOSPC. We have to then handle
> this error by using the shmem access to the pages.
> 
> Fixes: b50a53715f09 ("drm/i915: Support for pread/pwrite ... objects")
> Testcase: igt/gem_concurrent_blit
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Ankitprasad Sharma <ankitprasad.r.sharma@intel.com>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

Aside: Anything anywhere in the pipeline to make gtt mmap more robust for
ENOSPC?
-Daniel

> ---
>  drivers/gpu/drm/i915/i915_gem.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
> index 4644a7e67cf6..e37f73d3965c 100644
> --- a/drivers/gpu/drm/i915/i915_gem.c
> +++ b/drivers/gpu/drm/i915/i915_gem.c
> @@ -1306,7 +1306,7 @@ i915_gem_pwrite_ioctl(struct drm_device *dev, void *data,
>  		 * textures). Fallback to the shmem path in that case. */
>  	}
>  
> -	if (ret == -EFAULT) {
> +	if (ret == -EFAULT || ret == -ENOSPC) {
>  		if (obj->phys_handle)
>  			ret = i915_gem_phys_pwrite(obj, args, file);
>  		else if (i915_gem_object_has_struct_page(obj))
> -- 
> 2.8.1
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
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 ENOSPC after failing to insert a mappable node
  2016-07-19  6:55 ` [PATCH] " Daniel Vetter
@ 2016-07-19  7:09   ` Chris Wilson
  2016-07-19  8:28   ` Chris Wilson
  1 sibling, 0 replies; 6+ messages in thread
From: Chris Wilson @ 2016-07-19  7:09 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: Ankitprasad Sharma, intel-gfx

On Tue, Jul 19, 2016 at 08:55:55AM +0200, Daniel Vetter wrote:
> On Sat, Jul 16, 2016 at 06:42:36PM +0100, Chris Wilson wrote:
> > Even after adding individual page support for GTT mmaping, we can still
> > fail to find any space within the mappable region, and
> > drm_mm_insert_node() will then report ENOSPC. We have to then handle
> > this error by using the shmem access to the pages.
> > 
> > Fixes: b50a53715f09 ("drm/i915: Support for pread/pwrite ... objects")
> > Testcase: igt/gem_concurrent_blit
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > Cc: Ankitprasad Sharma <ankitprasad.r.sharma@intel.com>
> > Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com
> 
> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> 
> Aside: Anything anywhere in the pipeline to make gtt mmap more robust for
> ENOSPC?

Yes. They were on the list beginning of last year....

Fence tracking gets moved to the vma (that tides up some ringbuffer and
execbuf logic, including fixing up some failure cases there) and in the
process that enables us to support partial tiled faulting as well as
fixup the current breakage. About 120 patches in.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
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 ENOSPC after failing to insert a mappable node
  2016-07-19  6:55 ` [PATCH] " Daniel Vetter
  2016-07-19  7:09   ` Chris Wilson
@ 2016-07-19  8:28   ` Chris Wilson
  2016-07-19 14:33     ` Daniel Vetter
  1 sibling, 1 reply; 6+ messages in thread
From: Chris Wilson @ 2016-07-19  8:28 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: Ankitprasad Sharma, intel-gfx

On Tue, Jul 19, 2016 at 08:55:55AM +0200, Daniel Vetter wrote:
> On Sat, Jul 16, 2016 at 06:42:36PM +0100, Chris Wilson wrote:
> > Even after adding individual page support for GTT mmaping, we can still
> > fail to find any space within the mappable region, and
> > drm_mm_insert_node() will then report ENOSPC. We have to then handle
> > this error by using the shmem access to the pages.
> > 
> > Fixes: b50a53715f09 ("drm/i915: Support for pread/pwrite ... objects")
> > Testcase: igt/gem_concurrent_blit
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > Cc: Ankitprasad Sharma <ankitprasad.r.sharma@intel.com>
> > Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com
> 
> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

Thanks for the review, pushed.

Ideas for how we can stress this a bit directly than
gem_concurrent_blit?

We need to have many threads all pinning and then hitting the slow path
in the read (thus allowing another thread to come in and fail to claim
some aperture space for itself). Tricksy.

Hmm, how about fault-injection under I915_DEBUG?
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
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 ENOSPC after failing to insert a mappable node
  2016-07-19  8:28   ` Chris Wilson
@ 2016-07-19 14:33     ` Daniel Vetter
  0 siblings, 0 replies; 6+ messages in thread
From: Daniel Vetter @ 2016-07-19 14:33 UTC (permalink / raw)
  To: Chris Wilson, Daniel Vetter, intel-gfx, Ankitprasad Sharma

On Tue, Jul 19, 2016 at 09:28:34AM +0100, Chris Wilson wrote:
> On Tue, Jul 19, 2016 at 08:55:55AM +0200, Daniel Vetter wrote:
> > On Sat, Jul 16, 2016 at 06:42:36PM +0100, Chris Wilson wrote:
> > > Even after adding individual page support for GTT mmaping, we can still
> > > fail to find any space within the mappable region, and
> > > drm_mm_insert_node() will then report ENOSPC. We have to then handle
> > > this error by using the shmem access to the pages.
> > > 
> > > Fixes: b50a53715f09 ("drm/i915: Support for pread/pwrite ... objects")
> > > Testcase: igt/gem_concurrent_blit
> > > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > > Cc: Ankitprasad Sharma <ankitprasad.r.sharma@intel.com>
> > > Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com
> > 
> > Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> 
> Thanks for the review, pushed.
> 
> Ideas for how we can stress this a bit directly than
> gem_concurrent_blit?
> 
> We need to have many threads all pinning and then hitting the slow path
> in the read (thus allowing another thread to come in and fail to claim
> some aperture space for itself). Tricksy.
> 
> Hmm, how about fault-injection under I915_DEBUG?

I think fault injection is the only feasible way for such a fallback for a
fallback case. We need to entirely exhaust mmap gtt afaics at aleast.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
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:[~2016-07-19 14:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-16 17:42 [PATCH] drm/i915: Handle ENOSPC after failing to insert a mappable node Chris Wilson
2016-07-17  5:22 ` ✗ Ro.CI.BAT: failure for " Patchwork
2016-07-19  6:55 ` [PATCH] " Daniel Vetter
2016-07-19  7:09   ` Chris Wilson
2016-07-19  8:28   ` Chris Wilson
2016-07-19 14:33     ` Daniel Vetter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox