All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: intel-gfx@lists.freedesktop.org
Subject: [Intel-gfx] [PATCH 4/4] drm/i915: Tweak scheduler's kick_submission()
Date: Fri, 17 Jan 2020 11:15:46 +0000	[thread overview]
Message-ID: <20200117111546.3012803-4-chris@chris-wilson.co.uk> (raw)
In-Reply-To: <20200117111546.3012803-1-chris@chris-wilson.co.uk>

Skip useless priority bumping on adding a new dependency, but otherwise
prevent tasklet scheduling until we have completed all the potential
rescheduling.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/i915_scheduler.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_scheduler.c b/drivers/gpu/drm/i915/i915_scheduler.c
index 5d96cfba40f8..2b3f290ee1ad 100644
--- a/drivers/gpu/drm/i915/i915_scheduler.c
+++ b/drivers/gpu/drm/i915/i915_scheduler.c
@@ -216,12 +216,13 @@ static void kick_submission(struct intel_engine_cs *engine,
 	if (inflight->context == rq->context)
 		goto unlock;
 
-	engine->execlists.queue_priority_hint = prio;
 	if (need_preempt(prio, rq_prio(inflight)))
 		tasklet_hi_schedule(&engine->execlists.tasklet);
 
 unlock:
 	rcu_read_unlock();
+
+	engine->execlists.queue_priority_hint = prio;
 }
 
 static void __i915_schedule(struct i915_sched_node *node,
@@ -363,6 +364,9 @@ static void __bump_priority(struct i915_sched_node *node, unsigned int bump)
 {
 	struct i915_sched_attr attr = node->attr;
 
+	if (attr.priority & bump)
+		return;
+
 	attr.priority |= bump;
 	__i915_schedule(node, &attr);
 }
@@ -461,11 +465,15 @@ int i915_sched_node_add_dependency(struct i915_sched_node *node,
 	if (!dep)
 		return -ENOMEM;
 
+	local_bh_disable();
+
 	if (!__i915_sched_node_add_dependency(node, signal, dep,
 					      I915_DEPENDENCY_EXTERNAL |
 					      I915_DEPENDENCY_ALLOC))
 		i915_dependency_free(dep);
 
+	local_bh_enable(); /* kick submission tasklet */
+
 	return 0;
 }
 
-- 
2.25.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2020-01-17 11:15 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-17 11:15 [Intel-gfx] [PATCH 1/4] drm/i915: Only retire requests when eviction is allowed to blocked Chris Wilson
2020-01-17 11:15 ` [Intel-gfx] [PATCH 2/4] drm/i915: More proactive timeline retirement before new requests Chris Wilson
2020-01-17 11:15 ` [Intel-gfx] [PATCH 3/4] drm/i915/gt: Yield the timeslice if waiting on a semaphore Chris Wilson
2020-01-17 11:15 ` Chris Wilson [this message]
2020-01-17 14:20 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/4] drm/i915: Only retire requests when eviction is allowed to blocked Patchwork
2020-01-17 14:43 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2020-01-17 14:43 ` [Intel-gfx] ✗ Fi.CI.BUILD: warning " Patchwork
2020-01-20 13:42 ` [Intel-gfx] ✓ Fi.CI.IGT: success " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2019-12-06  9:45 [Intel-gfx] [PATCH 1/4] drm/i915/selftests: Disable heartbeats around long queues Chris Wilson
2019-12-06  9:45 ` [Intel-gfx] [PATCH 4/4] drm/i915: Tweak scheduler's kick_submission() Chris Wilson
2019-12-05 14:52 [Intel-gfx] [PATCH 1/4] drm/i915/selftests: Disable heartbeats around long queues Chris Wilson
2019-12-05 14:52 ` [Intel-gfx] [PATCH 4/4] drm/i915: Tweak scheduler's kick_submission() Chris Wilson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200117111546.3012803-4-chris@chris-wilson.co.uk \
    --to=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.