Re: [RFC 2/4] drm/i915/scheduler: Make insert_request resubmission aware

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Mar 28, 2017 at 08:00:27PM +0200, Michał Winiarski wrote:
> Normally when we're inserting requests with equal priority, we're using
> FIFO ordering. However, when we're resubmitting requests it's helpful
> to be able to ensure that they're executed before their dependencies,
> meaning that we need to use LIFO ordering instead.
> 
> Cc: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
> Cc: Joonas Lahtinen <joonas.lahtinen@xxxxxxxxxxxxxxx>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@xxxxxxxxx>
> Signed-off-by: Michał Winiarski <michal.winiarski@xxxxxxxxx>
> ---
>  drivers/gpu/drm/i915/intel_lrc.c | 15 ++++++++++-----
>  1 file changed, 10 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
> index 301ae7c..107cf91 100644
> --- a/drivers/gpu/drm/i915/intel_lrc.c
> +++ b/drivers/gpu/drm/i915/intel_lrc.c
> @@ -611,12 +611,15 @@ static void intel_lrc_irq_handler(unsigned long data)
>  	intel_uncore_forcewake_put(dev_priv, engine->fw_domains);
>  }
>  
> -static bool insert_request(struct i915_priotree *pt, struct rb_root *root)
> +static bool insert_request(struct i915_priotree *pt, struct rb_root *root,
> +			   bool reinsert)

I would just use a different insertion routine for unsubmit. The most
likely insertion point is execlist_first and so we can optimise the
reinsert to begin it's search there (we'll only have to search if there
were higher (than it) priority requests added that didn't trigger a
preemption).

I am not keen on making insert_request more complicated, semantically at
least. execlists_schedule() is built around the idea that the dependency
graphs are always have an order to their priority (no dependent request
can have a greater priority than their dependencies). insert_request()
is tightly coupled into that picture.

I need more coaxing, I have this nagging feeling that there is a simpler
way.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux