public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 11/13] drm/i915: Pass i915_sched_node around internally
Date: Tue, 7 May 2019 13:12:05 +0100	[thread overview]
Message-ID: <0bd15b27-fb38-71d1-cf50-2dc7f16104df@linux.intel.com> (raw)
In-Reply-To: <20190503115225.30831-11-chris@chris-wilson.co.uk>


On 03/05/2019 12:52, Chris Wilson wrote:
> To simplify the next patch, update bump_priority and schedule to accept
> the internal i915_sched_ndoe directly and not expect a request pointer.
> 
> add/remove: 0/0 grow/shrink: 2/1 up/down: 8/-15 (-7)
> Function                                     old     new   delta
> i915_schedule_bump_priority                  109     113      +4
> i915_schedule                                 50      54      +4
> __i915_schedule                              922     907     -15
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> ---
>   drivers/gpu/drm/i915/i915_scheduler.c | 33 +++++++++++++++------------
>   1 file changed, 18 insertions(+), 15 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_scheduler.c b/drivers/gpu/drm/i915/i915_scheduler.c
> index 4a95cf2201a7..380cb7343a10 100644
> --- a/drivers/gpu/drm/i915/i915_scheduler.c
> +++ b/drivers/gpu/drm/i915/i915_scheduler.c
> @@ -189,7 +189,7 @@ static void kick_submission(struct intel_engine_cs *engine, int prio)
>   	tasklet_hi_schedule(&engine->execlists.tasklet);
>   }
>   
> -static void __i915_schedule(struct i915_request *rq,
> +static void __i915_schedule(struct i915_sched_node *rq,

Can you not use rq for sched node, but perhaps node?

>   			    const struct i915_sched_attr *attr)
>   {
>   	struct intel_engine_cs *engine;
> @@ -203,13 +203,13 @@ static void __i915_schedule(struct i915_request *rq,
>   	lockdep_assert_held(&schedule_lock);
>   	GEM_BUG_ON(prio == I915_PRIORITY_INVALID);
>   
> -	if (i915_request_completed(rq))
> +	if (prio <= READ_ONCE(rq->attr.priority))
>   		return;
>   
> -	if (prio <= READ_ONCE(rq->sched.attr.priority))
> +	if (node_signaled(rq))

And refrain from re-ordering the sequence in this patch please.

>   		return;
>   
> -	stack.signaler = &rq->sched;
> +	stack.signaler = rq;
>   	list_add(&stack.dfs_link, &dfs);
>   
>   	/*
> @@ -260,9 +260,9 @@ static void __i915_schedule(struct i915_request *rq,
>   	 * execlists_submit_request()), we can set our own priority and skip
>   	 * acquiring the engine locks.
>   	 */
> -	if (rq->sched.attr.priority == I915_PRIORITY_INVALID) {
> -		GEM_BUG_ON(!list_empty(&rq->sched.link));
> -		rq->sched.attr = *attr;
> +	if (rq->attr.priority == I915_PRIORITY_INVALID) {
> +		GEM_BUG_ON(!list_empty(&rq->link));
> +		rq->attr = *attr;
>   
>   		if (stack.dfs_link.next == stack.dfs_link.prev)
>   			return;
> @@ -271,7 +271,7 @@ static void __i915_schedule(struct i915_request *rq,
>   	}
>   
>   	memset(&cache, 0, sizeof(cache));
> -	engine = rq->engine;
> +	engine = node_to_request(rq)->engine;
>   	spin_lock(&engine->timeline.lock);
>   
>   	/* Fifo and depth-first replacement ensure our deps execute before us */
> @@ -322,13 +322,20 @@ static void __i915_schedule(struct i915_request *rq,
>   void i915_schedule(struct i915_request *rq, const struct i915_sched_attr *attr)
>   {
>   	spin_lock_irq(&schedule_lock);
> -	__i915_schedule(rq, attr);
> +	__i915_schedule(&rq->sched, attr);
>   	spin_unlock_irq(&schedule_lock);
>   }
>   
> +static void __bump_priority(struct i915_sched_node *node, unsigned int bump)
> +{
> +	struct i915_sched_attr attr = node->attr;
> +
> +	attr.priority |= bump;
> +	__i915_schedule(node, &attr);
> +}
> +
>   void i915_schedule_bump_priority(struct i915_request *rq, unsigned int bump)
>   {
> -	struct i915_sched_attr attr;
>   	unsigned long flags;
>   
>   	GEM_BUG_ON(bump & ~I915_PRIORITY_MASK);
> @@ -337,11 +344,7 @@ void i915_schedule_bump_priority(struct i915_request *rq, unsigned int bump)
>   		return;
>   
>   	spin_lock_irqsave(&schedule_lock, flags);
> -
> -	attr = rq->sched.attr;
> -	attr.priority |= bump;
> -	__i915_schedule(rq, &attr);
> -
> +	__bump_priority(&rq->sched, bump);
>   	spin_unlock_irqrestore(&schedule_lock, flags);
>   }
>   
> 

Regards,

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

  reply	other threads:[~2019-05-07 12:12 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-03 11:52 [PATCH 01/13] drm/i915: Assert breadcrumbs are correctly ordered in the signal handler Chris Wilson
2019-05-03 11:52 ` [PATCH 02/13] drm/i915: Prefer checking the wakeref itself rather than the counter Chris Wilson
2019-05-07 10:48   ` Tvrtko Ursulin
2019-05-03 11:52 ` [PATCH 03/13] drm/i915: Assert the local engine->wakeref is active Chris Wilson
2019-05-07 10:52   ` Tvrtko Ursulin
2019-05-03 11:52 ` [PATCH 04/13] drm/i915/hangcheck: Replace hangcheck.seqno with RING_HEAD Chris Wilson
2019-05-03 11:52 ` [PATCH 05/13] drm/i915: Remove delay for idle_work Chris Wilson
2019-05-07 10:54   ` Tvrtko Ursulin
2019-05-03 11:52 ` [PATCH 06/13] drm/i915: Cancel retire_worker on parking Chris Wilson
2019-05-07 10:55   ` Tvrtko Ursulin
2019-05-03 11:52 ` [PATCH 07/13] drm/i915: Stop spinning for DROP_IDLE (debugfs/i915_drop_caches) Chris Wilson
2019-05-03 11:52 ` [PATCH 08/13] drm/i915: Only reschedule the submission tasklet if preemption is possible Chris Wilson
2019-05-07 11:53   ` Tvrtko Ursulin
2019-05-03 11:52 ` [PATCH 09/13] drm/i915/execlists: Don't apply priority boost for resets Chris Wilson
2019-05-07 12:04   ` Tvrtko Ursulin
2019-05-03 11:52 ` [PATCH 10/13] drm/i915: Rearrange i915_scheduler.c Chris Wilson
2019-05-07 12:06   ` Tvrtko Ursulin
2019-05-03 11:52 ` [PATCH 11/13] drm/i915: Pass i915_sched_node around internally Chris Wilson
2019-05-07 12:12   ` Tvrtko Ursulin [this message]
2019-05-07 12:26     ` Chris Wilson
2019-05-03 11:52 ` [PATCH 12/13] drm/i915: Bump signaler priority on adding a waiter Chris Wilson
2019-05-07 12:46   ` Tvrtko Ursulin
2019-05-07 13:14     ` Chris Wilson
2019-05-07 14:32       ` Tvrtko Ursulin
2019-05-07 14:38       ` Chris Wilson
2019-05-03 11:52 ` [PATCH 13/13] drm/i915: Disable semaphore busywaits on saturated systems Chris Wilson
2019-05-03 12:56 ` ✗ Fi.CI.SPARSE: warning for series starting with [01/13] drm/i915: Assert breadcrumbs are correctly ordered in the signal handler Patchwork
2019-05-03 13:18 ` ✗ Fi.CI.BAT: failure " Patchwork
2019-05-03 13:32 ` [PATCH 01/13] " Tvrtko Ursulin
2019-05-03 13:37   ` Chris Wilson
2019-05-03 13:49     ` Tvrtko Ursulin
2019-05-03 15:22 ` [PATCH v2] " Chris Wilson
2019-05-07 10:39   ` Tvrtko Ursulin
2019-05-03 15:38 ` ✗ Fi.CI.SPARSE: warning for series starting with [v2] drm/i915: Assert breadcrumbs are correctly ordered in the signal handler (rev2) Patchwork
2019-05-03 15:53 ` ✓ Fi.CI.BAT: success " Patchwork
2019-05-03 19:22 ` ✗ Fi.CI.IGT: failure " Patchwork

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=0bd15b27-fb38-71d1-cf50-2dc7f16104df@linux.intel.com \
    --to=tvrtko.ursulin@linux.intel.com \
    --cc=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox