From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: dong.yang@intel.com, intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH] drm/i915/gt: Do not add same i915_request to intel_context twice
Date: Fri, 10 Dec 2021 08:51:04 +0000 [thread overview]
Message-ID: <d8e9dfad-7665-cc29-9f53-ff350c8a402d@linux.intel.com> (raw)
In-Reply-To: <20211210013147.2256699-1-dong.yang@intel.com>
On 10/12/2021 01:31, dong.yang@intel.com wrote:
> From: "Yang, Dong" <dong.yang@intel.com>
>
> With unknow race condition, the i915_request will be added
What do you mean with unknown here?
> to intel_context list twice, and result in system panic.
>
> If node alreay exist then do not add it again.
Note the call chains are under ce->signal_lock and protecting from double add AFAICT:
static void insert_breadcrumb(struct i915_request *rq)
{
...
if (test_bit(I915_FENCE_FLAG_SIGNAL, &rq->fence.flags))
return;
...
set_bit(I915_FENCE_FLAG_SIGNAL, &rq->fence.flags);
bool i915_request_enable_breadcrumb(struct i915_request *rq)
{
...
spin_lock(&ce->signal_lock);
if (test_bit(I915_FENCE_FLAG_ACTIVE, &rq->fence.flags))
insert_breadcrumb(rq);
spin_unlock(&ce->signal_lock);
void i915_request_cancel_breadcrumb(struct i915_request *rq)
{
...
spin_lock(&ce->signal_lock);
if (!test_and_clear_bit(I915_FENCE_FLAG_SIGNAL, &rq->fence.flags)) {
spin_unlock(&ce->signal_lock);
return;
}
void intel_context_remove_breadcrumbs(struct intel_context *ce,
struct intel_breadcrumbs *b)
{
...
spin_lock_irqsave(&ce->signal_lock, flags);
if (list_empty(&ce->signals))
goto unlock;
list_for_each_entry_safe(rq, rn, &ce->signals, signal_link) {
GEM_BUG_ON(!__i915_request_is_complete(rq));
if (!test_and_clear_bit(I915_FENCE_FLAG_SIGNAL,
&rq->fence.flags))
continue;
The last one in signal_irq_work is guarded by the __i915_request_is_complete check.
So I think more context is needed on how you found this may be an issue.
Regards,
Tvrtko
>
> Signed-off-by: Yang, Dong <dong.yang@intel.com>
> ---
> drivers/gpu/drm/i915/gt/intel_breadcrumbs.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/gt/intel_breadcrumbs.c b/drivers/gpu/drm/i915/gt/intel_breadcrumbs.c
> index 209cf265bf74..9c7bc060d2ae 100644
> --- a/drivers/gpu/drm/i915/gt/intel_breadcrumbs.c
> +++ b/drivers/gpu/drm/i915/gt/intel_breadcrumbs.c
> @@ -387,6 +387,9 @@ static void insert_breadcrumb(struct i915_request *rq)
> }
> }
>
> + if (&rq->signal_link == pos)
> + return;
> +
> i915_request_get(rq);
> list_add_rcu(&rq->signal_link, pos);
> GEM_BUG_ON(!check_signal_order(ce, rq));
>
next prev parent reply other threads:[~2021-12-10 8:51 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-10 1:31 [Intel-gfx] [PATCH] drm/i915/gt: Do not add same i915_request to intel_context twice dong.yang
2021-12-10 8:51 ` Tvrtko Ursulin [this message]
2021-12-13 1:53 ` Yang, Dong
2021-12-13 9:36 ` Tvrtko Ursulin
2021-12-14 5:58 ` Yang, Dong
2021-12-14 15:40 ` Tvrtko Ursulin
2021-12-10 11:00 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2021-12-10 11:31 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2021-12-11 4:59 ` [Intel-gfx] ✗ Fi.CI.IGT: 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=d8e9dfad-7665-cc29-9f53-ff350c8a402d@linux.intel.com \
--to=tvrtko.ursulin@linux.intel.com \
--cc=dong.yang@intel.com \
--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.