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
Cc: matthew.auld@intel.com
Subject: Re: [PATCH 3/3] drm/i915: Flush the workqueue before draining
Date: Thu, 04 Jul 2019 13:22:17 +0300	[thread overview]
Message-ID: <87lfxe2j6u.fsf@gaia.fi.intel.com> (raw)
In-Reply-To: <20190703171913.16585-4-chris@chris-wilson.co.uk>

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

> Trying to drain a workqueue while we may still be adding to it from
> background tasks is, according to kernel/workqueue.c, verboten. So, add
> a flush_workqueue() at the start of our cleanup procedure.

I don't get it. drain_workqueue does it's own flushing.
-Mika

>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> ---
>  drivers/gpu/drm/i915/i915_drv.h | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 9d132c9d17b0..d2f9af3a16dc 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -2472,6 +2472,7 @@ static inline void i915_gem_drain_workqueue(struct drm_i915_private *i915)
>  	 */
>  	int pass = 3;
>  	do {
> +		flush_workqueue(i915->wq);
>  		rcu_barrier();
>  		i915_gem_drain_freed_objects(i915);
>  	} while (--pass);
> -- 
> 2.20.1
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2019-07-04 10:22 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-03 17:19 Just a selection of some fine brown paper bags Chris Wilson
2019-07-03 17:19 ` [PATCH 1/3] drm/i915/gem: Defer obj->base.resv fini until RCU callback Chris Wilson
2019-07-03 18:06   ` [PATCH v2] " Chris Wilson
2019-07-04 13:53   ` [PATCH 1/3] " Mika Kuoppala
2019-07-04 14:02     ` Chris Wilson
2019-07-04 14:18       ` Mika Kuoppala
2019-07-04 14:22         ` Chris Wilson
2019-07-03 17:19 ` [PATCH 2/3] drm/i915/gtt: Defer the free for alloc error paths Chris Wilson
2019-07-04 10:14   ` Mika Kuoppala
2019-07-04 10:28   ` Matthew Auld
2019-07-04 10:40     ` Chris Wilson
2019-07-04 10:58       ` Mika Kuoppala
2019-07-04 11:02         ` Chris Wilson
2019-07-04 11:40           ` Mika Kuoppala
2019-07-03 17:19 ` [PATCH 3/3] drm/i915: Flush the workqueue before draining Chris Wilson
2019-07-04 10:22   ` Mika Kuoppala [this message]
2019-07-04 10:26     ` Chris Wilson
2019-07-04 12:39       ` Mika Kuoppala
2019-07-03 19:36 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [v2] drm/i915/gem: Defer obj->base.resv fini until RCU callback (rev2) Patchwork
2019-07-03 19:53 ` ✓ Fi.CI.BAT: success " Patchwork
2019-07-05  0:35 ` ✓ 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=87lfxe2j6u.fsf@gaia.fi.intel.com \
    --to=mika.kuoppala@linux.intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=matthew.auld@intel.com \
    /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.