drm/i915: Downgrade NEWCLIENT to non-preemptive
authorChris Wilson <chris@chris-wilson.co.uk>
Wed, 15 May 2019 13:00:51 +0000 (14:00 +0100)
committerJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
Mon, 20 May 2019 15:28:22 +0000 (18:28 +0300)
Commit 1413b2bc0717 ("drm/i915: Trim NEWCLIENT boosting") had the
intended consequence of not allowing a sequence of work that merely
crossed into a new engine the privilege to be promoted to NEWCLIENT
status. It also had the unintended consequence of actually making
NEWCLIENT effective on heavily oversubscribed transcode machines and
impacting upon their throughput.

If we consider a client packet composed of (rcsA, rcsB, vcs) and 30 of
those clients, using the NEWCLIENT boost that will be scheduled as

rcsA x 30, (rcsB, vcs) x 30

where as before it would have been

(rcsA, rcsB, vcs) x 30

That is with NEWCLIENT only boosting the first request of each client,
we would execute all rcsA requests prior to running on the vcs engines;
acruing a lot of dead time as compared to the previous case where the
vcs engine would be started in parallel to processing the second client.

The previous patch has the effect of delaying submission until it is
required by a third party (either the user with an explicit wait, or by
another client/engine). We reduce the NEWCLIENT bump to a mere WAIT,
which has the effect of removing its preemptive grant and reducing it to
the same level as any other user interaction -- that it will not be
promoted above the interengine dependencies, and so preventing NEWCLIENTS
from starving other engines. This a large nerf to the rrul properties of
the current NEWCLIENT, but it still does give prioritised submission to
new requests from light workloads.

References: b16c765122f9 ("drm/i915: Priority boost for new clients")
Fixes: 1413b2bc0717 ("drm/i915: Trim NEWCLIENT boosting") # customer impact
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Dmitry Rogozhkin <dmitry.v.rogozhkin@intel.com>
Cc: Dmitry Ermilov <dmitry.ermilov@intel.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190515130052.4475-4-chris@chris-wilson.co.uk
(cherry picked from commit 68fc728b01fcc93b26d52f6e884e738962a49a66)
Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
drivers/gpu/drm/i915/i915_priolist_types.h
drivers/gpu/drm/i915/i915_request.c
drivers/gpu/drm/i915/intel_lrc.c

index cc44ebd3b55308cd508d9d134ab4707456964854..49709de69875ae039d4dbd27558d8654e6b2c162 100644 (file)
@@ -20,15 +20,14 @@ enum {
        I915_PRIORITY_INVALID = INT_MIN
 };
 
-#define I915_USER_PRIORITY_SHIFT 3
+#define I915_USER_PRIORITY_SHIFT 2
 #define I915_USER_PRIORITY(x) ((x) << I915_USER_PRIORITY_SHIFT)
 
 #define I915_PRIORITY_COUNT BIT(I915_USER_PRIORITY_SHIFT)
 #define I915_PRIORITY_MASK (I915_PRIORITY_COUNT - 1)
 
 #define I915_PRIORITY_WAIT             ((u8)BIT(0))
-#define I915_PRIORITY_NEWCLIENT                ((u8)BIT(1))
-#define I915_PRIORITY_NOSEMAPHORE      ((u8)BIT(2))
+#define I915_PRIORITY_NOSEMAPHORE      ((u8)BIT(1))
 
 #define __NO_PREEMPTION (I915_PRIORITY_WAIT)
 
index f258281bf3f3bfcefb77c132df55b0b4db482faa..ede79886cf981a832b2da0ea334b7d04acbf877c 100644 (file)
@@ -1228,7 +1228,7 @@ void i915_request_add(struct i915_request *request)
                 * the bulk clients. (FQ_CODEL)
                 */
                if (list_empty(&request->sched.signalers_list))
-                       attr.priority |= I915_PRIORITY_NEWCLIENT;
+                       attr.priority |= I915_PRIORITY_WAIT;
 
                engine->schedule(request, &attr);
        }
index 4e0a351bfbcadb7a1e0d13a591dcbafaac5ef80d..11e5a86610bf7eb6187ced817015cf3f4c98f4ba 100644 (file)
 #define WA_TAIL_DWORDS 2
 #define WA_TAIL_BYTES (sizeof(u32) * WA_TAIL_DWORDS)
 
-#define ACTIVE_PRIORITY (I915_PRIORITY_NEWCLIENT | I915_PRIORITY_NOSEMAPHORE)
+#define ACTIVE_PRIORITY (I915_PRIORITY_NOSEMAPHORE)
 
 static int execlists_context_deferred_alloc(struct intel_context *ce,
                                            struct intel_engine_cs *engine);