public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v2 02/11] drm/i915/execlists: Cache the last priolist lookup
Date: Thu, 28 Sep 2017 14:59:01 +0300	[thread overview]
Message-ID: <1506599941.5415.11.camel@linux.intel.com> (raw)
In-Reply-To: <20170927164440.19678-3-chris@chris-wilson.co.uk>

On Wed, 2017-09-27 at 17:44 +0100, Chris Wilson wrote:
> From: Michał Winiarski <michal.winiarski@intel.com>
> 
> Avoid the repeated rbtree lookup for each request as we unwind them by
> tracking the last priolist.
> 
> v2: Fix up my unhelpful suggestion of using default_priolist.
> 
> Signed-off-by: Michał Winiarski <michal.winiarski@intel.com>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

<SNIP>

> +++ b/drivers/gpu/drm/i915/intel_lrc.c
> @@ -358,25 +358,31 @@ static void unwind_wa_tail(struct drm_i915_gem_request *rq)
>  static void unwind_incomplete_requests(struct intel_engine_cs *engine)
>  {
>  	struct drm_i915_gem_request *rq, *rn;
> +	struct i915_priolist *uninitialized_var(p);
> +	int last_prio = INT_MAX;
>  
>  	lockdep_assert_held(&engine->timeline->lock);
>  
>  	list_for_each_entry_safe_reverse(rq, rn,
>  					 &engine->timeline->requests,
>  					 link) {
> -		struct i915_priolist *p;
> -
>  		if (i915_gem_request_completed(rq))
>  			return;
>  
>  		__i915_gem_request_unsubmit(rq);
>  		unwind_wa_tail(rq);
>  
> -		p = lookup_priolist(engine,
> -				    &rq->priotree,
> -				    rq->priotree.priority);
> -		list_add(&rq->priotree.link,
> -			 &ptr_mask_bits(p, 1)->requests);
> +		GEM_BUG_ON(rq->priotree.priority == INT_MAX);

This doesn't read aloud too logically when coming from the ring reset
codepath, at first like would seem like we're not allowing maximum
priority tasks to be unwinded (which only makes sense on the pre-empt
odepath). #define INVALID_PRIORITY INT_MAX might help

Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>

Regards, Joonas
-- 
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2017-09-28 11:59 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-27 16:44 Execlists preemption & user priority Chris Wilson
2017-09-27 16:44 ` [PATCH v2 01/11] drm/i915/execlists: Move request unwinding to a separate function Chris Wilson
2017-09-28 11:49   ` Joonas Lahtinen
2017-09-27 16:44 ` [PATCH v2 02/11] drm/i915/execlists: Cache the last priolist lookup Chris Wilson
2017-09-28 11:59   ` Joonas Lahtinen [this message]
2017-09-28 12:05     ` Chris Wilson
2017-09-27 16:44 ` [PATCH v2 03/11] drm/i915/preempt: Fix WaEnablePreemptionGranularityControlByUMD Chris Wilson
2017-09-28 12:06   ` Joonas Lahtinen
2017-09-27 16:44 ` [PATCH v2 04/11] drm/i915/preempt: Default to disabled mid-command preemption levels Chris Wilson
2017-09-28 12:22   ` Joonas Lahtinen
2017-09-27 16:44 ` [PATCH v2 05/11] drm/i915/execlists: Distinguish the incomplete context notifies Chris Wilson
2017-09-28  4:59   ` Wang, Zhi A
2017-09-28 12:23   ` Joonas Lahtinen
2017-09-27 16:44 ` [PATCH v2 06/11] drm/i915: Introduce a preempt context Chris Wilson
2017-09-28 12:32   ` Joonas Lahtinen
2017-09-28 12:42     ` Chris Wilson
2017-09-27 16:44 ` [PATCH v2 07/11] drm/i915/execlists: Move bdw GPGPU w/a to emit_bb Chris Wilson
2017-09-28 12:50   ` Joonas Lahtinen
2017-09-27 16:44 ` [PATCH v2 08/11] drm/i915/execlists: Keep request->priority for its lifetime Chris Wilson
2017-09-28  9:14   ` Michał Winiarski
2017-09-28  9:31     ` Chris Wilson
2017-09-28  9:32       ` Chris Wilson
2017-09-28 11:09   ` Chris Wilson
2017-09-28 13:21     ` Michał Winiarski
2017-09-28 12:59   ` Joonas Lahtinen
2017-09-27 16:44 ` [PATCH v2 09/11] drm/i915: Expand I915_PARAM_HAS_SCHEDULER into a capability bitmask Chris Wilson
2017-09-28 13:07   ` Joonas Lahtinen
2017-09-28 13:11     ` Chris Wilson
2017-09-27 16:44 ` [PATCH v2 10/11] drm/i915/execlists: Preemption! Chris Wilson
2017-09-28 14:10   ` Joonas Lahtinen
2017-09-28 18:35     ` Chris Wilson
2017-09-27 16:44 ` [PATCH v2 11/11] drm/i915/scheduler: Support user-defined priorities Chris Wilson
2017-09-28 14:14   ` Joonas Lahtinen
2017-09-27 17:28 ` ✓ Fi.CI.BAT: success for series starting with [v2,01/11] drm/i915/execlists: Move request unwinding to a separate function Patchwork
2017-09-27 22:12 ` ✗ 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=1506599941.5415.11.camel@linux.intel.com \
    --to=joonas.lahtinen@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