diff mbox

[v5,18/35] drm/i915: Added scheduler support to page fault handler

Message ID 1455805644-6450-19-git-send-email-John.C.Harrison@Intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

John Harrison Feb. 18, 2016, 2:27 p.m. UTC
From: John Harrison <John.C.Harrison@Intel.com>

GPU page faults can now require scheduler operation in order to
complete. For example, in order to free up sufficient memory to handle
the fault the handler must wait for a batch buffer to complete that
has not even been sent to the hardware yet. Thus EAGAIN no longer
means a GPU hang, it can occur under normal operation.

For: VIZ-1587
Signed-off-by: John Harrison <John.C.Harrison@Intel.com>
---
 drivers/gpu/drm/i915/i915_gem.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

Comments

Jesse Barnes Feb. 19, 2016, 7:45 p.m. UTC | #1
On 02/18/2016 06:27 AM, John.C.Harrison@Intel.com wrote:
> From: John Harrison <John.C.Harrison@Intel.com>
> 
> GPU page faults can now require scheduler operation in order to
> complete. For example, in order to free up sufficient memory to handle
> the fault the handler must wait for a batch buffer to complete that
> has not even been sent to the hardware yet. Thus EAGAIN no longer
> means a GPU hang, it can occur under normal operation.
> 
> For: VIZ-1587
> Signed-off-by: John Harrison <John.C.Harrison@Intel.com>
> ---
>  drivers/gpu/drm/i915/i915_gem.c | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
> index 17b44b3..a47a495 100644
> --- a/drivers/gpu/drm/i915/i915_gem.c
> +++ b/drivers/gpu/drm/i915/i915_gem.c
> @@ -2003,10 +2003,15 @@ out:
>  		}
>  	case -EAGAIN:
>  		/*
> -		 * EAGAIN means the gpu is hung and we'll wait for the error
> -		 * handler to reset everything when re-faulting in
> +		 * EAGAIN can mean the gpu is hung and we'll have to wait for
> +		 * the error handler to reset everything when re-faulting in
>  		 * i915_mutex_lock_interruptible.
> +		 *
> +		 * It can also indicate various other nonfatal errors for which
> +		 * the best response is to give other threads a chance to run,
> +		 * and then retry the failing operation in its entirety.
>  		 */
> +		/*FALLTHRU*/
>  	case 0:
>  	case -ERESTARTSYS:
>  	case -EINTR:
> 

Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 17b44b3..a47a495 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -2003,10 +2003,15 @@  out:
 		}
 	case -EAGAIN:
 		/*
-		 * EAGAIN means the gpu is hung and we'll wait for the error
-		 * handler to reset everything when re-faulting in
+		 * EAGAIN can mean the gpu is hung and we'll have to wait for
+		 * the error handler to reset everything when re-faulting in
 		 * i915_mutex_lock_interruptible.
+		 *
+		 * It can also indicate various other nonfatal errors for which
+		 * the best response is to give other threads a chance to run,
+		 * and then retry the failing operation in its entirety.
 		 */
+		/*FALLTHRU*/
 	case 0:
 	case -ERESTARTSYS:
 	case -EINTR: