From mboxrd@z Thu Jan 1 00:00:00 1970 From: John.C.Harrison@Intel.com Subject: [RFC 27/44] drm/i915: Added scheduler support to page fault handler Date: Thu, 26 Jun 2014 18:24:18 +0100 Message-ID: <1403803475-16337-28-git-send-email-John.C.Harrison@Intel.com> References: <1403803475-16337-1-git-send-email-John.C.Harrison@Intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTP id 6F1126E246 for ; Thu, 26 Jun 2014 10:25:42 -0700 (PDT) In-Reply-To: <1403803475-16337-1-git-send-email-John.C.Harrison@Intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: Intel-GFX@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org From: John Harrison 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. --- drivers/gpu/drm/i915/i915_gem.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 5ed5f66..aa1e0b2 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -1622,10 +1622,16 @@ 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. */ + set_need_resched(); + /*FALLTHRU*/ case 0: case -ERESTARTSYS: case -EINTR: -- 1.7.9.5