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 09/10] drm/i915/execlist: Trim immediate timeslice expiry
Date: Tue, 15 Oct 2019 13:43:05 +0100	[thread overview]
Message-ID: <70bfa0de-8e48-6405-8693-a78f45646ef8@linux.intel.com> (raw)
In-Reply-To: <20191014220534.1662-9-chris@chris-wilson.co.uk>


On 14/10/2019 23:05, Chris Wilson wrote:
> We perform timeslicing immediately upon receipt of a request that may be
> put into the second ELSP slot. The idea behind this was that since we
> didn't install the timer if the second ELSP slot was empty, we would not
> have any idea of how long ELSP[0] had been running and so giving the
> newcomer a chance on the GPU was fair. However, this causes us extra
> busy work that we may be able to avoid if we wait a jiffie for the first
> timeslice as normal.
 >
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> ---
>   drivers/gpu/drm/i915/gt/intel_lrc.c | 6 ++++--
>   1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/gt/intel_lrc.c b/drivers/gpu/drm/i915/gt/intel_lrc.c
> index 60e897c000b2..f9bf78032ad7 100644
> --- a/drivers/gpu/drm/i915/gt/intel_lrc.c
> +++ b/drivers/gpu/drm/i915/gt/intel_lrc.c
> @@ -1613,7 +1613,7 @@ static void execlists_dequeue(struct intel_engine_cs *engine)
>   			last->hw_context->lrc_desc |= CTX_DESC_FORCE_RESTORE;
>   			last = NULL;
>   		} else if (need_timeslice(engine, last) &&
> -			   !timer_pending(&engine->execlists.timer)) {
> +			   timer_expired(&engine->execlists.timer)) {

timer_expired is !timer_pending(..) && t->expires. Presumably that means 
it was scheduled at least once in the past but currently isn't. Then 
immediately after the first timer the t->expires check becomes useless? 
I must be missing something.. Oh, you have piggy-backed some custom code 
to timers.. hm.. Looks like it would work.

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Regards,

Tvrtko

>   			GEM_TRACE("%s: expired last=%llx:%lld, prio=%d, hint=%d\n",
>   				  engine->name,
>   				  last->fence.context,
> @@ -2074,6 +2074,8 @@ static void process_csb(struct intel_engine_cs *engine)
>   
>   			if (enable_timeslice(execlists))
>   				mod_timer(&execlists->timer, jiffies + 1);
> +			else
> +				cancel_timer(&execlists->timer);
>   
>   			WRITE_ONCE(execlists->pending[0], NULL);
>   		} else {
> @@ -3591,7 +3593,7 @@ gen12_emit_fini_breadcrumb_rcs(struct i915_request *request, u32 *cs)
>   
>   static void execlists_park(struct intel_engine_cs *engine)
>   {
> -	del_timer(&engine->execlists.timer);
> +	cancel_timer(&engine->execlists.timer);
>   	cancel_timer(&engine->execlists.preempt);
>   }
>   
> 
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2019-10-15 12:43 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-14 22:05 [PATCH 01/10] drm/i915/gem: Distinguish each object type Chris Wilson
2019-10-14 22:05 ` [PATCH 02/10] drm/i915/execlists: Clear semaphore immediately upon ELSP promotion Chris Wilson
2019-10-15  9:16   ` Tvrtko Ursulin
2019-10-15  9:26     ` Chris Wilson
2019-10-14 22:05 ` [PATCH 03/10] drm/i915: Expose engine properties via sysfs Chris Wilson
2019-10-15  9:14   ` Tvrtko Ursulin
2019-10-14 22:05 ` [PATCH 04/10] drm/i915/execlists: Force preemption Chris Wilson
2019-10-14 22:05 ` [PATCH 05/10] drm/i915/gt: Introduce barrier pulses along engines Chris Wilson
2019-10-14 22:05 ` [PATCH 06/10] drm/i915/execlists: Cancel banned contexts on schedule-out Chris Wilson
2019-10-14 22:05 ` [PATCH 07/10] drm/i915/gem: Cancel non-persistent contexts on close Chris Wilson
2019-10-15 12:15   ` Tvrtko Ursulin
2019-10-15 12:19     ` Chris Wilson
2019-10-15 12:49       ` Tvrtko Ursulin
2019-10-14 22:05 ` [PATCH 08/10] drm/i915: Replace hangcheck by heartbeats Chris Wilson
2019-10-14 22:05 ` [PATCH 09/10] drm/i915/execlist: Trim immediate timeslice expiry Chris Wilson
2019-10-15 12:43   ` Tvrtko Ursulin [this message]
2019-10-14 22:05 ` [PATCH 10/10] drm/i915: Flush idle barriers when waiting Chris Wilson
2019-10-14 23:09 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [01/10] drm/i915/gem: Distinguish each object type Patchwork
2019-10-14 23:15 ` ✗ Fi.CI.SPARSE: " Patchwork
2019-10-14 23:36 ` ✗ Fi.CI.BAT: 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=70bfa0de-8e48-6405-8693-a78f45646ef8@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