From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 1/2] drm/i915/execlists: Protect peeking at execlists->active
Date: Wed, 9 Oct 2019 16:38:43 +0100 [thread overview]
Message-ID: <ef48a430-eb52-b4d9-e9a8-adb389188efe@linux.intel.com> (raw)
In-Reply-To: <20191009100955.21477-1-chris@chris-wilson.co.uk>
On 09/10/2019 11:09, Chris Wilson wrote:
> Now that we dropped the engine->active.lock serialisation from around
> process_csb(), direct submission can run concurrently to the interrupt
> handler. As such execlists->active may be advanced as we dequeue,
> dropping the reference to the request. We need to employ our RCU request
> protection to ensure that the request is not freed too early.
>
> Fixes: df403069029d ("drm/i915/execlists: Lift process_csb() out of the irq-off spinlock")
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> ---
> drivers/gpu/drm/i915/gt/intel_lrc.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/gt/intel_lrc.c b/drivers/gpu/drm/i915/gt/intel_lrc.c
> index 6db762c509b8..7ea58335f04c 100644
> --- a/drivers/gpu/drm/i915/gt/intel_lrc.c
> +++ b/drivers/gpu/drm/i915/gt/intel_lrc.c
> @@ -1289,7 +1289,7 @@ static void virtual_xfer_breadcrumbs(struct virtual_engine *ve,
> static struct i915_request *
> last_active(const struct intel_engine_execlists *execlists)
> {
> - struct i915_request * const *last = execlists->active;
> + struct i915_request * const *last = READ_ONCE(execlists->active);
>
> while (*last && i915_request_completed(*last))
> last++;
> @@ -1981,8 +1981,11 @@ static void process_csb(struct intel_engine_cs *engine)
> static void __execlists_submission_tasklet(struct intel_engine_cs *const engine)
> {
> lockdep_assert_held(&engine->active.lock);
> - if (!engine->execlists.pending[0])
> + if (!engine->execlists.pending[0]) {
> + rcu_read_lock(); /* protect peeking at execlists->active */
> execlists_dequeue(engine);
> + rcu_read_unlock();
> + }
> }
>
> /*
>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Regards,
Tvrtko
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2019-10-09 15:38 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-09 10:09 [PATCH 1/2] drm/i915/execlists: Protect peeking at execlists->active Chris Wilson
2019-10-09 10:09 ` [PATCH 2/2] drm/i915/gt: execlists->active is serialised by the tasklet Chris Wilson
2019-10-09 10:26 ` [PATCH] " Chris Wilson
2019-10-09 15:53 ` Tvrtko Ursulin
2019-10-09 15:59 ` Chris Wilson
2019-10-09 16:37 ` Tvrtko Ursulin
2019-10-09 17:07 ` Chris Wilson
2019-10-09 16:09 ` [PATCH v2] " Chris Wilson
2019-10-09 16:32 ` Chris Wilson
2019-10-09 16:59 ` Tvrtko Ursulin
2019-10-09 15:27 ` ✓ Fi.CI.BAT: success for series starting with [1/2] drm/i915/execlists: Protect peeking at execlists->active (rev2) Patchwork
2019-10-09 15:38 ` Tvrtko Ursulin [this message]
2019-10-09 17:41 ` ✗ Fi.CI.BAT: failure for series starting with [1/2] drm/i915/execlists: Protect peeking at execlists->active (rev3) Patchwork
2019-10-09 20:03 ` ✓ Fi.CI.BAT: success for series starting with [1/2] drm/i915/execlists: Protect peeking at execlists->active (rev4) Patchwork
2019-10-10 3:24 ` ✓ Fi.CI.IGT: " 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=ef48a430-eb52-b4d9-e9a8-adb389188efe@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.