All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mika Kuoppala <mika.kuoppala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915/gt: Only drop heartbeat.systole if the sole owner
Date: Wed, 06 Nov 2019 16:40:27 +0200	[thread overview]
Message-ID: <87d0e5nk4k.fsf@gaia.fi.intel.com> (raw)
In-Reply-To: <20191106133129.17732-1-chris@chris-wilson.co.uk>

Chris Wilson <chris@chris-wilson.co.uk> writes:

> Mika spotted that only using cancel_delayed_work() could mean that we
> attempted to clear the heartbeat.systole while the worker was still
> running. Rectify the situation by only touching the systole from outside
> the worker if we suceeded in cancelling the worker before it could run.

succeeded

> The worker is expected to clean up by itself upon idling.
>
> Reported-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
> Fixes: 058179e72e09 ("drm/i915/gt: Replace hangcheck by heartbeats")
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/gt/intel_engine_heartbeat.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/gt/intel_engine_heartbeat.c b/drivers/gpu/drm/i915/gt/intel_engine_heartbeat.c
> index 5051f304705b..06aa14c7aa8c 100644
> --- a/drivers/gpu/drm/i915/gt/intel_engine_heartbeat.c
> +++ b/drivers/gpu/drm/i915/gt/intel_engine_heartbeat.c
> @@ -141,8 +141,8 @@ void intel_engine_unpark_heartbeat(struct intel_engine_cs *engine)
>  
>  void intel_engine_park_heartbeat(struct intel_engine_cs *engine)
>  {
> -	cancel_delayed_work(&engine->heartbeat.work);
> -	i915_request_put(fetch_and_zero(&engine->heartbeat.systole));
> +	if (cancel_delayed_work(&engine->heartbeat.work))
> +		i915_request_put(fetch_and_zero(&engine->heartbeat.systole));

We don't arm in park path so this should do the trick.

Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>

>  }
>  
>  void intel_engine_init_heartbeat(struct intel_engine_cs *engine)
> -- 
> 2.24.0
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

WARNING: multiple messages have this Message-ID (diff)
From: Mika Kuoppala <mika.kuoppala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH] drm/i915/gt: Only drop heartbeat.systole if the sole owner
Date: Wed, 06 Nov 2019 16:40:27 +0200	[thread overview]
Message-ID: <87d0e5nk4k.fsf@gaia.fi.intel.com> (raw)
Message-ID: <20191106144027.bZHNL_InedwkhpQnUZKho5O2SecyyMiJ_kEiicQwstI@z> (raw)
In-Reply-To: <20191106133129.17732-1-chris@chris-wilson.co.uk>

Chris Wilson <chris@chris-wilson.co.uk> writes:

> Mika spotted that only using cancel_delayed_work() could mean that we
> attempted to clear the heartbeat.systole while the worker was still
> running. Rectify the situation by only touching the systole from outside
> the worker if we suceeded in cancelling the worker before it could run.

succeeded

> The worker is expected to clean up by itself upon idling.
>
> Reported-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
> Fixes: 058179e72e09 ("drm/i915/gt: Replace hangcheck by heartbeats")
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/gt/intel_engine_heartbeat.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/gt/intel_engine_heartbeat.c b/drivers/gpu/drm/i915/gt/intel_engine_heartbeat.c
> index 5051f304705b..06aa14c7aa8c 100644
> --- a/drivers/gpu/drm/i915/gt/intel_engine_heartbeat.c
> +++ b/drivers/gpu/drm/i915/gt/intel_engine_heartbeat.c
> @@ -141,8 +141,8 @@ void intel_engine_unpark_heartbeat(struct intel_engine_cs *engine)
>  
>  void intel_engine_park_heartbeat(struct intel_engine_cs *engine)
>  {
> -	cancel_delayed_work(&engine->heartbeat.work);
> -	i915_request_put(fetch_and_zero(&engine->heartbeat.systole));
> +	if (cancel_delayed_work(&engine->heartbeat.work))
> +		i915_request_put(fetch_and_zero(&engine->heartbeat.systole));

We don't arm in park path so this should do the trick.

Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>

>  }
>  
>  void intel_engine_init_heartbeat(struct intel_engine_cs *engine)
> -- 
> 2.24.0
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2019-11-06 14:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-06 13:31 [PATCH] drm/i915/gt: Only drop heartbeat.systole if the sole owner Chris Wilson
2019-11-06 13:31 ` [Intel-gfx] " Chris Wilson
2019-11-06 14:40 ` Mika Kuoppala [this message]
2019-11-06 14:40   ` Mika Kuoppala
2019-11-06 16:25 ` ✓ Fi.CI.BAT: success for " Patchwork
2019-11-06 16:25   ` [Intel-gfx] " Patchwork
2019-11-07 14:56 ` ✓ Fi.CI.IGT: " Patchwork
2019-11-07 14:56   ` [Intel-gfx] " 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=87d0e5nk4k.fsf@gaia.fi.intel.com \
    --to=mika.kuoppala@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.