Skip to content

Commit 6b7133b

Browse files
committed
drm/i915/gt: Always reset the timeslice after a context switch
Currently, we reset the timer after a pre-eemption event. This has the side-effect that the timeslice runs into the second context after the first is completed after a normal promotion event, causing the second context to be swapped out early and switched for a third context. To be more fair, we want to reset the clock after promotion as well. Signed-off-by: Chris Wilson <[email protected]> Cc: Tvrtko Ursulin <[email protected]> Reviewed-by: Tvrtko Ursulin <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 5422d87 commit 6b7133b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/gpu/drm/i915/gt/intel_lrc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1694,7 +1694,7 @@ active_timeslice(const struct intel_engine_cs *engine)
16941694
{
16951695
const struct i915_request *rq = *engine->execlists.active;
16961696

1697-
if (i915_request_completed(rq))
1697+
if (!rq || i915_request_completed(rq))
16981698
return 0;
16991699

17001700
if (engine->execlists.switch_priority_hint < effective_prio(rq))
@@ -2285,7 +2285,6 @@ static void process_csb(struct intel_engine_cs *engine)
22852285

22862286
/* Point active to the new ELSP; prevent overwriting */
22872287
WRITE_ONCE(execlists->active, execlists->pending);
2288-
set_timeslice(engine);
22892288

22902289
if (!inject_preempt_hang(execlists))
22912290
ring_set_paused(engine, 0);
@@ -2326,6 +2325,7 @@ static void process_csb(struct intel_engine_cs *engine)
23262325
} while (head != tail);
23272326

23282327
execlists->csb_head = head;
2328+
set_timeslice(engine);
23292329

23302330
/*
23312331
* Gen11 has proven to fail wrt global observation point between

0 commit comments

Comments
 (0)