From ce1bfa04eb36f1fd645b9599f3350ca61538a8f0 Mon Sep 17 00:00:00 2001 From: Daniel Vetter Date: Fri, 11 Jun 2021 22:01:49 +0200 Subject: drm/i915/eb: Drop unmotivated cond_resched MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This was added in commit 2889caa9232109afc8881f29a2205abeb5709d0c Author: Chris Wilson Date: Fri Jun 16 15:05:19 2017 +0100 drm/i915: Eliminate lots of iterations over the execobjects array without any motivation. I suspect it was added to handle EAGAIN errors from userptr, but it's hard to guess with no breadcrumbs anywhere. Before this change there wasn't any dedicated EAGAIN handling, we just bounced completely to userspace. Userptr works differently now and does not just thrash the cpu until another worker has maybe acquired the pages, so we can go back to handling EAGAIN like beforehand. That also allows us to drop another funky repeat loop from a function with already very complicated control flow (which unforunately got more complex due to ww_mutex restarting). Signed-off-by: Daniel Vetter Cc: Jon Bloomfield Cc: Chris Wilson Cc: Maarten Lankhorst Cc: Joonas Lahtinen Cc: Daniel Vetter Cc: "Thomas Hellström" Cc: Matthew Auld Cc: Lionel Landwerlin Cc: Dave Airlie Cc: Jason Ekstrand --- drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c index 9f8c32c93d82..dc2daf780ffd 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c @@ -1795,7 +1795,7 @@ repeat: i915_gem_ww_ctx_fini(&eb->ww); /* - * We take 3 passes through the slowpatch. + * We take 2 passes through the slowpatch. * * 1 - we try to just prefault all the user relocation entries and * then attempt to reuse the atomic pagefault disabled fast path again. @@ -1803,18 +1803,12 @@ repeat: * 2 - we copy the user entries to a local buffer here outside of the * local and allow ourselves to wait upon any rendering before * relocations - * - * 3 - we already have a local copy of the relocation entries, but - * were interrupted (EAGAIN) whilst waiting for the objects, try again. */ if (!err) { err = eb_prefault_relocations(eb); } else if (!have_copy) { err = eb_copy_relocations(eb); have_copy = err == 0; - } else { - cond_resched(); - err = 0; } if (!err) @@ -1877,9 +1871,6 @@ err: goto repeat_validate; } - if (err == -EAGAIN) - goto repeat; - out: if (have_copy) { const unsigned int count = eb->buffer_count; -- cgit v1.2.3