All of 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 05/71] drm/i915/execlists: Disable submission tasklets when rescheduling
Date: Thu, 3 May 2018 18:49:27 +0100	[thread overview]
Message-ID: <1b079968-8413-7d7e-a97b-38d4c254f28b@linux.intel.com> (raw)
In-Reply-To: <20180503063757.22238-5-chris@chris-wilson.co.uk>


On 03/05/2018 07:36, Chris Wilson wrote:
> As we reschedule the requests, we do not want the submission tasklet
> running until we finish updating the priority chains. (We start
> rewriting priorities from the oldest, but the dequeue looks at the most
> recent in-flight, so there is a small race condition where dequeue may
> decide that preemption is falsely required.) Combine the tasklet kicking
> from adding a new request with the set-wedge protection so that we only
> have to adjust the preempt-counter once to achieve both goals.
> 
> Reported-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> ---
>   drivers/gpu/drm/i915/i915_gem.c     | 4 ++--
>   drivers/gpu/drm/i915/i915_request.c | 5 +----
>   2 files changed, 3 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
> index 5ece6ae4bdff..03cd30001b5d 100644
> --- a/drivers/gpu/drm/i915/i915_gem.c
> +++ b/drivers/gpu/drm/i915/i915_gem.c
> @@ -578,10 +578,10 @@ static void __fence_set_priority(struct dma_fence *fence,
>   	rq = to_request(fence);
>   	engine = rq->engine;
>   
> -	rcu_read_lock();
> +	local_bh_disable(); /* RCU serialisation for set-wedged protection */
>   	if (engine->schedule)
>   		engine->schedule(rq, attr);
> -	rcu_read_unlock();
> +	local_bh_enable(); /* kick the tasklets if queues were reprioritised */
>   }
>   
>   static void fence_set_priority(struct dma_fence *fence,
> diff --git a/drivers/gpu/drm/i915/i915_request.c b/drivers/gpu/drm/i915/i915_request.c
> index 75061f9e48eb..0756fafa7f81 100644
> --- a/drivers/gpu/drm/i915/i915_request.c
> +++ b/drivers/gpu/drm/i915/i915_request.c
> @@ -1109,12 +1109,9 @@ void __i915_request_add(struct i915_request *request, bool flush_caches)
>   	 * decide whether to preempt the entire chain so that it is ready to
>   	 * run at the earliest possible convenience.
>   	 */
> -	rcu_read_lock();
> +	local_bh_disable();
>   	if (engine->schedule)
>   		engine->schedule(request, &request->ctx->sched);
> -	rcu_read_unlock();
> -
> -	local_bh_disable();
>   	i915_sw_fence_commit(&request->submit);
>   	local_bh_enable(); /* Kick the execlists tasklet if just scheduled */
>   
> 

AFAICS this doesn't disable tasklets running on other CPUs in parallel, 
on different engines, so they still may see the non-atomic (wrt 
schedule) snapshot of the submission queues. So I am not sure what it 
means. It prevents a tasklet from interrupt the schedule of this request 
- but as I said, I am not sure of the benefit.

Regards,

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

  reply	other threads:[~2018-05-03 17:49 UTC|newest]

Thread overview: 65+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-03  6:36 [PATCH 01/71] drm/i915/execlists: Drop preemption arbitrations points along the ring Chris Wilson
2018-05-03  6:36 ` [PATCH 02/71] drm/i915/execlists: Emit i915_trace_request_out for preemption Chris Wilson
2018-05-03  6:36 ` [PATCH 03/71] drm/i915: Lazily unbind vma on close Chris Wilson
2018-05-03 16:59   ` Tvrtko Ursulin
2018-05-03  6:36 ` [PATCH 04/71] drm/i915: Keep one request in our ring_list Chris Wilson
2018-05-03 17:04   ` Tvrtko Ursulin
2018-05-03  6:36 ` [PATCH 05/71] drm/i915/execlists: Disable submission tasklets when rescheduling Chris Wilson
2018-05-03 17:49   ` Tvrtko Ursulin [this message]
2018-05-03 19:50     ` Chris Wilson
2018-05-04  9:15       ` Tvrtko Ursulin
2018-05-04  9:31         ` Chris Wilson
2018-05-03  6:36 ` [PATCH 06/71] drm/i915: Detect if we missed kicking the execlists tasklet Chris Wilson
2018-05-03 13:08   ` Chris Wilson
2018-05-03  6:36 ` [PATCH 07/71] drm/i915: Move request->ctx aside Chris Wilson
2018-05-03  6:36 ` [PATCH 08/71] drm/i915: Move fiddling with engine->last_retired_context Chris Wilson
2018-05-03  6:36 ` [PATCH 09/71] drm/i915: Store a pointer to intel_context in i915_request Chris Wilson
2018-05-04 10:31   ` Tvrtko Ursulin
2018-05-03  6:36 ` [PATCH 10/71] drm/i915/execlists: Refactor out complete_preempt_context() Chris Wilson
2018-05-03  6:36 ` [PATCH 11/71] drm/i915: Move engine reset prepare/finish to backends Chris Wilson
2018-05-03  6:36 ` [PATCH 12/71] drm/i915: Split execlists/guc reset preparations Chris Wilson
2018-05-03  6:36 ` [PATCH 13/71] drm/i915/execlists: Flush pending preemption events during reset Chris Wilson
2018-05-03  6:37 ` [PATCH 14/71] drm/i915: Combine tasklet_kill and tasklet_disable Chris Wilson
2018-05-03  6:37 ` [PATCH 15/71] drm/i915: Stop parking the signaler around reset Chris Wilson
2018-05-03  6:37 ` [PATCH 16/71] drm/i915: Be irqsafe inside reset Chris Wilson
2018-05-03  6:37 ` [PATCH 17/71] drm/i915/execlists: Make submission tasklet hardirq safe Chris Wilson
2018-05-03  6:37 ` [PATCH 18/71] drm/i915/guc: " Chris Wilson
2018-05-03  6:37 ` [PATCH 19/71] drm/i915: Allow init_breadcrumbs to be used from irq context Chris Wilson
2018-05-03  6:37 ` [PATCH 20/71] drm/i915/execlists: Force preemption via reset on timeout Chris Wilson
2018-05-03  6:37 ` [PATCH 21/71] drm/i915/execlists: Try preempt-reset from hardirq timer context Chris Wilson
2018-05-03  6:37 ` [PATCH 22/71] drm/i915/preemption: Select timeout when scheduling Chris Wilson
2018-05-03  6:37 ` [PATCH 23/71] drm/i915: Use a preemption timeout to enforce interactivity Chris Wilson
2018-05-03  6:37 ` [PATCH 24/71] drm/i915: Allow user control over preempt timeout on their important context Chris Wilson
2018-05-03  6:37 ` [PATCH 25/71] drm/i915: Disable preemption and sleeping while using the punit sideband Chris Wilson
2018-05-03  6:37 ` [PATCH 26/71] drm/i915: Lift acquiring the vlv punit magic to a common sb-get Chris Wilson
2018-05-03  6:37 ` [PATCH 27/71] drm/i915: Lift sideband locking for vlv_punit_(read|write) Chris Wilson
2018-05-03  6:37 ` [PATCH 28/71] drm/i915: Reduce RPS update frequency on Valleyview/Cherryview Chris Wilson
2018-05-03  6:37 ` [PATCH 29/71] Revert "drm/i915: Avoid tweaking evaluation thresholds on Baytrail v3" Chris Wilson
2018-05-03  6:37 ` [PATCH 30/71] drm/i915: Replace pcu_lock with sb_lock Chris Wilson
2018-05-03  6:37 ` [PATCH 31/71] drm/i915: Separate sideband declarations to intel_sideband.h Chris Wilson
2018-05-03  6:37 ` [PATCH 32/71] drm/i915: Merge sbi read/write into a single accessor Chris Wilson
2018-05-03  6:37 ` [PATCH 33/71] drm/i915: Merge sandybridge_pcode_(read|write) Chris Wilson
2018-05-03  6:37 ` [PATCH 34/71] drm/i915: Move sandybride pcode access to intel_sideband.c Chris Wilson
2018-05-03  6:37 ` [PATCH 35/71] drm/i915: Mark up Ironlake ips with rpm wakerefs Chris Wilson
2018-05-03  6:37 ` [PATCH 36/71] drm/i915: Record logical context support in driver caps Chris Wilson
2018-05-03  6:37 ` [PATCH 37/71] drm/i915: Generalize i915_gem_sanitize() to reset contexts Chris Wilson
2018-05-03  6:37 ` [PATCH 38/71] drm/i915: Enable render context support for Ironlake (gen5) Chris Wilson
2018-05-03  8:47   ` Chris Wilson
2018-05-03  6:37 ` [PATCH 39/71] drm/i915: Enable render context support for gen4 (Broadwater to Cantiga) Chris Wilson
2018-05-03  6:37 ` [PATCH 40/71] drm/i915: Split GT powermanagement functions to intel_gt_pm.c Chris Wilson
2018-05-03  6:37 ` [PATCH 41/71] drm/i915: Move rps worker " Chris Wilson
2018-05-03  6:37 ` [PATCH 42/71] drm/i915: Move all the RPS irq handlers to intel_gt_pm Chris Wilson
2018-05-03  6:37 ` [PATCH 43/71] drm/i915: Track HAS_RPS alongside HAS_RC6 in the device info Chris Wilson
2018-05-03  6:37 ` [PATCH 44/71] drm/i915: Remove defunct intel_suspend_gt_powersave() Chris Wilson
2018-05-03  6:37 ` [PATCH 45/71] drm/i915: Reorder GT interface code Chris Wilson
2018-05-03  6:37 ` [PATCH 46/71] drm/i915: Split control of rps and rc6 Chris Wilson
2018-05-03  6:37 ` [PATCH 47/71] drm/i915: Enabling rc6 and rps have different requirements, so separate them Chris Wilson
2018-05-03  6:37 ` [PATCH 48/71] drm/i915: Simplify rc6/rps enabling Chris Wilson
2018-05-03  6:37 ` [PATCH 49/71] drm/i915: Refactor frequency bounds computation Chris Wilson
2018-05-03  6:37 ` [PATCH 50/71] drm/i915: Rename rps min/max frequencies Chris Wilson
2018-05-03  6:37 ` [PATCH 51/71] drm/i915: Pull IPS into GT power management Chris Wilson
2018-05-03 10:13 ` [PATCH 01/71] drm/i915/execlists: Drop preemption arbitrations points along the ring Lionel Landwerlin
2018-05-03 10:18   ` Chris Wilson
2018-05-03 10:28     ` Lionel Landwerlin
2018-05-03 10:38       ` Chris Wilson
2018-05-03 16:37 ` Tvrtko Ursulin

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=1b079968-8413-7d7e-a97b-38d4c254f28b@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.