All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 1/3] drm/i915: Repeat flush of idle work during suspend
Date: Thu, 22 Dec 2016 14:19:27 +0200	[thread overview]
Message-ID: <1482409167.7292.14.camel@linux.intel.com> (raw)
In-Reply-To: <20161222120007.28590-1-chris@chris-wilson.co.uk>

On to, 2016-12-22 at 12:00 +0000, Chris Wilson wrote:
> The idle work handler is self-arming - if it detects that it needs to
> run again it will queue itself from its work handler. Take greater care
> when trying to drain the idle work, and double check that it is flushed.
> 
> The free worker has a similar issue where it is armed by an RCU task
> which may be running concurrently with us.
> 
> This should hopefully help with the sporadic WARN_ON(dev_priv->gt.awake)
> from i915_gem_suspend.
> 
> v2: Reuse drain_freed_objects.
> v3: Don't try to flush the freed objects from the shrinker, as it may be
> underneath the struct_mutex already.

<SNIP>

> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -3207,6 +3207,13 @@ i915_gem_object_create_from_data(struct drm_i915_private *dev_priv,
>  void i915_gem_close_object(struct drm_gem_object *gem, struct drm_file *file);
>  void i915_gem_free_object(struct drm_gem_object *obj);
>  
> +static inline void i915_gem_drain_freed_objects(struct drm_i915_private *i915)
> +{
> +	rcu_barrier();
> +	while (flush_work(&i915->mm.free_work))
> +		rcu_barrier();

Looks much like do { } while();

Also make a comment that we loop just for paranoia.

> @@ -4262,8 +4262,10 @@ int i915_gem_suspend(struct drm_i915_private *dev_priv)
>  
>  	cancel_delayed_work_sync(&dev_priv->gpu_error.hangcheck_work);
>  	cancel_delayed_work_sync(&dev_priv->gt.retire_work);
> -	flush_delayed_work(&dev_priv->gt.idle_work);
> -	flush_work(&dev_priv->mm.free_work);

Put a comment here that idle_work is re-arming.

> +	while (flush_delayed_work(&dev_priv->gt.idle_work))
> +		;
> +
> +	i915_gem_drain_freed_objects(dev_priv);
>  
>  	/* Assert that we sucessfully flushed all the work and
>  	 * reset the GPU back to its idle, low power state.

Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>

Regards, Joonas
-- 
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2016-12-22 12:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-22 12:00 [PATCH 1/3] drm/i915: Repeat flush of idle work during suspend Chris Wilson
2016-12-22 12:00 ` [PATCH 2/3] drm/i915: Don't clflush before release phys object Chris Wilson
2016-12-22 12:40   ` Joonas Lahtinen
2016-12-22 12:00 ` [PATCH 3/3] drm/i915: Silence allocation failure during sg_trim() Chris Wilson
2016-12-22 12:02   ` Joonas Lahtinen
2016-12-22 12:19 ` Joonas Lahtinen [this message]
2016-12-22 18:26 ` ✗ Fi.CI.BAT: warning for series starting with [1/3] drm/i915: Repeat flush of idle work during suspend 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=1482409167.7292.14.camel@linux.intel.com \
    --to=joonas.lahtinen@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.