Intel-GFX Archive on lore.kernel.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 10/12] drm/i915/execlists: Reduce lock contention between schedule/submit_request
Date: Mon, 15 May 2017 11:51:52 +0100	[thread overview]
Message-ID: <ca628833-0c53-4f08-d8c8-d33cd9176115@linux.intel.com> (raw)
In-Reply-To: <20170511195922.15844-10-chris@chris-wilson.co.uk>


On 11/05/2017 20:59, Chris Wilson wrote:
> If we do not require to perform priority bumping, and we haven't yet
> submitted the request, we can update its priority in situ and skip
> acquiring the engine locks -- thus avoiding any contention between us
> and submit/execute.
>
> v2: Remove the stack element from the list if we can do the early
> assignment.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> ---
>  drivers/gpu/drm/i915/intel_lrc.c | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
> index 7e41529bd074..3cfb4b145b75 100644
> --- a/drivers/gpu/drm/i915/intel_lrc.c
> +++ b/drivers/gpu/drm/i915/intel_lrc.c
> @@ -767,6 +767,19 @@ static void execlists_schedule(struct drm_i915_gem_request *request, int prio)
>  		list_safe_reset_next(dep, p, dfs_link);
>  	}
>
> +	/* If we didn't need to bump any existing priorities, and we haven't
> +	 * yet submitted this request (i.e. there is no potential race with
> +	 * execlists_submit_request()), we can set our own priority and skip
> +	 * acquiring the engine locks.
> +	 */
> +	if (request->priotree.priority == INT_MIN) {
> +		GEM_BUG_ON(!list_empty(&request->priotree.link));
> +		request->priotree.priority = prio;
> +		if (stack.dfs_link.next == stack.dfs_link.prev)
> +			return;
> +		__list_del_entry(&stack.dfs_link);

Hm is early processing the out of queue request with no dependencies 
safe? Recently you fixed a race in this area, which AFAIK was about 
doing that outside the engine lock and then request becoming ready in 
parallel, racing with the FIFO order.

Regards,

Tvrtko

> +	}
> +
>  	engine = request->engine;
>  	spin_lock_irq(&engine->timeline->lock);
>
>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2017-05-15 10:52 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-11 19:59 [PATCH 01/12] drm/i915: Remove kref from i915_sw_fence Chris Wilson
2017-05-11 19:59 ` [PATCH 02/12] drm/i915: Import the kfence selftests for i915_sw_fence Chris Wilson
2017-05-15 10:52   ` [PATCH v2] " Chris Wilson
2017-05-16  8:55     ` Chris Wilson
2017-05-16  9:15       ` Mika Kuoppala
2017-05-16 14:49     ` Mika Kuoppala
2017-05-11 19:59 ` [PATCH 03/12] drm/i915: Make ptr_unpack_bits() more function-like Chris Wilson
2017-05-11 19:59 ` [PATCH 04/12] drm/i915: Redefine ptr_pack_bits() and friends Chris Wilson
2017-05-11 19:59 ` [PATCH 05/12] drm/i915/execlists: Pack the count into the low bits of the port.request Chris Wilson
2017-05-11 19:59 ` [PATCH 06/12] drm/i915: Don't mark an execlists context-switch when idle Chris Wilson
2017-05-11 19:59 ` [PATCH 07/12] drm/i915: Use a define for the default priority [0] Chris Wilson
2017-05-12  8:02   ` Mika Kuoppala
2017-05-11 19:59 ` [PATCH 08/12] drm/i915: Split execlist priority queue into rbtree + linked list Chris Wilson
2017-05-15 11:45   ` Tvrtko Ursulin
2017-05-15 12:26     ` Chris Wilson
2017-05-15 12:56   ` [PATCH v2] " Chris Wilson
2017-05-15 13:27     ` Chris Wilson
2017-05-15 13:29     ` [PATCH v3] " Chris Wilson
2017-05-15 14:51       ` Michał Winiarski
2017-05-16  7:55       ` Tvrtko Ursulin
2017-05-11 19:59 ` [PATCH 09/12] drm/i915: Create a kmem_cache to allocate struct i915_priolist from Chris Wilson
2017-05-16  7:57   ` Tvrtko Ursulin
2017-05-11 19:59 ` [PATCH 10/12] drm/i915/execlists: Reduce lock contention between schedule/submit_request Chris Wilson
2017-05-15 10:51   ` Tvrtko Ursulin [this message]
2017-05-15 10:55     ` Chris Wilson
2017-05-15 11:46       ` Tvrtko Ursulin
2017-05-11 19:59 ` [PATCH 11/12] drm/i915: Stop inlining the execlists IRQ handler Chris Wilson
2017-05-11 19:59 ` [PATCH 12/12] drm/i915: Don't force serialisation on marking up execlists irq posted Chris Wilson
2017-05-12  7:16   ` Mika Kuoppala
2017-05-15 10:33   ` Tvrtko Ursulin
2017-05-11 20:17 ` ✓ Fi.CI.BAT: success for series starting with [01/12] drm/i915: Remove kref from i915_sw_fence Patchwork
2017-05-12  7:43 ` [PATCH 01/12] " Mika Kuoppala
2017-05-12  8:19   ` Chris Wilson
2017-05-12 12:13 ` Mika Kuoppala
2017-05-15 11:47 ` ✓ Fi.CI.BAT: success for series starting with [01/12] drm/i915: Remove kref from i915_sw_fence (rev2) Patchwork
2017-05-15 14:01 ` ✓ Fi.CI.BAT: success for series starting with [01/12] drm/i915: Remove kref from i915_sw_fence (rev4) 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=ca628833-0c53-4f08-d8c8-d33cd9176115@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