All of lore.kernel.org
 help / color / mirror / Atom feed
From: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 04/21] drm/i915: Refresh the errno to vmf_fault translations
Date: Tue, 3 Sep 2019 18:34:52 +0300	[thread overview]
Message-ID: <e040a35e-d030-502a-b475-c043400a5025@linux.intel.com> (raw)
In-Reply-To: <20190902040303.14195-4-chris@chris-wilson.co.uk>


On 02/09/2019 7.02, Chris Wilson wrote:
> It's been a long time since we accidentally reported -EIO upon wedging,
> it can now only be generated by failure to swap in a page.
> 

Reviewed-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>

> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/gem/i915_gem_mman.c | 39 +++++++++---------------
>  1 file changed, 15 insertions(+), 24 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/gem/i915_gem_mman.c b/drivers/gpu/drm/i915/gem/i915_gem_mman.c
> index 261c9bd83f51..82db2b783123 100644
> --- a/drivers/gpu/drm/i915/gem/i915_gem_mman.c
> +++ b/drivers/gpu/drm/i915/gem/i915_gem_mman.c
> @@ -287,6 +287,9 @@ vm_fault_t i915_gem_fault(struct vm_fault *vmf)
>  			view.type = I915_GGTT_VIEW_PARTIAL;
>  			vma = i915_gem_object_ggtt_pin(obj, &view, 0, 0, flags);
>  		}
> +
> +		/* The entire mappable GGTT is pinned? Unexpected! */
> +		GEM_BUG_ON(vma == ERR_PTR(-ENOSPC));
>  	}
>  	if (IS_ERR(vma)) {
>  		ret = PTR_ERR(vma);
> @@ -333,23 +336,19 @@ vm_fault_t i915_gem_fault(struct vm_fault *vmf)
>  	i915_gem_object_unpin_pages(obj);
>  err:
>  	switch (ret) {
> -	case -EIO:
> -		/*
> -		 * We eat errors when the gpu is terminally wedged to avoid
> -		 * userspace unduly crashing (gl has no provisions for mmaps to
> -		 * fail). But any other -EIO isn't ours (e.g. swap in failure)
> -		 * and so needs to be reported.
> -		 */
> -		if (!intel_gt_is_wedged(ggtt->vm.gt))
> -			return VM_FAULT_SIGBUS;
> -		/* else, fall through */
> -	case -EAGAIN:
> -		/*
> -		 * EAGAIN means the gpu is hung and we'll wait for the error
> -		 * handler to reset everything when re-faulting in
> -		 * i915_mutex_lock_interruptible.
> -		 */
> +	default:
> +		WARN_ONCE(ret, "unhandled error in %s: %i\n", __func__, ret);
> +		/* fallthrough */
> +	case -EIO: /* shmemfs failure from swap device */
> +	case -EFAULT: /* purged object */
> +		return VM_FAULT_SIGBUS;
> +
> +	case -ENOSPC: /* shmemfs allocation failure */
> +	case -ENOMEM: /* our allocation failure */
> +		return VM_FAULT_OOM;
> +
>  	case 0:
> +	case -EAGAIN:
>  	case -ERESTARTSYS:
>  	case -EINTR:
>  	case -EBUSY:
> @@ -358,14 +357,6 @@ vm_fault_t i915_gem_fault(struct vm_fault *vmf)
>  		 * already did the job.
>  		 */
>  		return VM_FAULT_NOPAGE;
> -	case -ENOMEM:
> -		return VM_FAULT_OOM;
> -	case -ENOSPC:
> -	case -EFAULT:
> -		return VM_FAULT_SIGBUS;
> -	default:
> -		WARN_ONCE(ret, "unhandled error in %s: %i\n", __func__, ret);
> -		return VM_FAULT_SIGBUS;
>  	}
>  }
>  
> 
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2019-09-03 15:34 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-02  4:02 [PATCH 01/21] drm/i915: Restrict the aliasing-ppgtt to the size of the ggtt Chris Wilson
2019-09-02  4:02 ` [PATCH 02/21] drm/i915: Report aliasing ppgtt size as ggtt size Chris Wilson
2019-09-02  8:55   ` Matthew Auld
2019-09-02  4:02 ` [PATCH 03/21] drm/i915/execlists: Ignore lost completion events Chris Wilson
2019-09-02  4:02 ` [PATCH 04/21] drm/i915: Refresh the errno to vmf_fault translations Chris Wilson
2019-09-03 15:34   ` Abdiel Janulgue [this message]
2019-09-02  4:02 ` [PATCH 05/21] drm/i915: Replace obj->pin_global with obj->frontbuffer Chris Wilson
2019-09-02  4:02 ` [PATCH 06/21] dma-fence: Serialise signal enabling (dma_fence_enable_sw_signaling) Chris Wilson
2019-09-02  4:02 ` [PATCH 07/21] drm/mm: Pack allocated/scanned boolean into a bitfield Chris Wilson
2019-09-02  4:02 ` [PATCH 08/21] drm/i915: Make shrink/unshrink be atomic Chris Wilson
2019-09-10 19:54   ` Matthew Auld
2019-09-02  4:02 ` [PATCH 09/21] drm/i915: Only track bound elements of the GTT Chris Wilson
2019-09-02  4:02 ` [PATCH 10/21] drm/i915: Make i915_vma.flags atomic_t for mutex reduction Chris Wilson
2019-09-10 20:06   ` Matthew Auld
2019-09-02  4:02 ` [PATCH 11/21] drm/i915/gtt: Make sure the gen6 ppgtt is bound before first use Chris Wilson
2019-09-10 20:17   ` Matthew Auld
2019-09-02  4:02 ` [PATCH 12/21] drm/i915: Mark up address spaces that may need to allocate Chris Wilson
2019-09-20 16:22   ` Tvrtko Ursulin
2019-09-20 16:35     ` Chris Wilson
2019-09-23  8:10       ` Tvrtko Ursulin
2019-09-25  8:23         ` Chris Wilson
2019-09-25 15:59           ` Tvrtko Ursulin
2019-09-27 17:03             ` Chris Wilson
2019-09-02  4:02 ` [PATCH 13/21] drm/i915: Pull i915_vma_pin under the vm->mutex Chris Wilson
2019-09-16 10:13   ` Tvrtko Ursulin
2019-09-16 11:10     ` Chris Wilson
2019-09-17 12:37   ` Tvrtko Ursulin
2019-09-17 18:56     ` Chris Wilson
2019-09-19 13:37       ` Tvrtko Ursulin
2019-09-19 14:05         ` Chris Wilson
2019-09-02  4:02 ` [PATCH 14/21] drm/i915: Push the i915_active.retire into a worker Chris Wilson
2019-09-02  4:02 ` [PATCH 15/21] drm/i915: Coordinate i915_active with its own mutex Chris Wilson
2019-09-20 16:14   ` Tvrtko Ursulin
2019-09-20 16:32     ` Chris Wilson
2019-09-02  4:02 ` [PATCH 16/21] drm/i915: Move idle barrier cleanup into engine-pm Chris Wilson
2019-09-20 16:18   ` Tvrtko Ursulin
2019-09-02  4:02 ` [PATCH 17/21] drm/i915: Drop struct_mutex from around i915_retire_requests() Chris Wilson
2019-09-24 15:25   ` Tvrtko Ursulin
2019-09-25  8:43     ` Chris Wilson
2019-09-25  8:49       ` Tvrtko Ursulin
2019-09-02  4:03 ` [PATCH 18/21] drm/i915: Remove the GEM idle worker Chris Wilson
2019-09-24 15:26   ` Tvrtko Ursulin
2019-09-02  4:03 ` [PATCH 19/21] drm/i915: Merge wait_for_timelines with retire_request Chris Wilson
2019-09-24 15:57   ` Tvrtko Ursulin
2019-09-25  8:54     ` Chris Wilson
2019-09-02  4:03 ` [PATCH 20/21] drm/i915: Move request runtime management onto gt Chris Wilson
2019-09-02  4:03 ` [PATCH 21/21] drm/i915: Move global activity tracking from GEM to GT Chris Wilson
2019-09-25  9:55   ` Tvrtko Ursulin
2019-09-02  4:54 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [01/21] drm/i915: Restrict the aliasing-ppgtt to the size of the ggtt Patchwork
2019-09-02  5:20 ` ✓ Fi.CI.BAT: success " Patchwork
2019-09-02  8:00 ` ✗ Fi.CI.IGT: failure " Patchwork
2019-09-02  8:52 ` [PATCH 01/21] " Matthew Auld

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e040a35e-d030-502a-b475-c043400a5025@linux.intel.com \
    --to=abdiel.janulgue@linux.intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.