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
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Subject: Re: [PATCH] drm/i915: Mark up i915_vma_unbind() as a potential sleeper
Date: Thu, 09 Nov 2017 13:57:15 +0200	[thread overview]
Message-ID: <1510228635.6305.13.camel@linux.intel.com> (raw)
In-Reply-To: <20171109105947.13557-1-chris@chris-wilson.co.uk>

On Thu, 2017-11-09 at 10:59 +0000, Chris Wilson wrote:
> Whenever we want to unbind a vma, we must wait on all GPU activity to
> complete first. (This is what gives us the ability to do fine grained
> eviction and purging by only having to wait on the VMA that we need to
> unbind to proceed; though if pushed we can make it a rule that we are
> only allowed to unbind already idle VMA and move the burden of the work
> and organising the sleep onto the caller.) Currently, we might only
> sleep if the vma is still active on the GPU, but in principle
> i915_vma_unbind() always implies a sleep, so mark it up with a
> might_sleep().
> 
> Suggested-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Cc: Matthew Auld <matthew.william.auld@gmail.com>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>

<SNIP>

> +++ b/drivers/gpu/drm/i915/i915_vma.c
> @@ -743,6 +743,7 @@ int i915_vma_unbind(struct i915_vma *vma)
>  	/* First wait upon any activity as retiring the request may
>  	 * have side-effects such as unpinning or even unbinding this vma.
>  	 */
> +	might_sleep();

Please lift this up, even before lockdep_assert_held, for more clarity.

might_sleep();
lockdep_assert_held(...);

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

  reply	other threads:[~2017-11-09 11:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-09 10:59 [PATCH] drm/i915: Mark up i915_vma_unbind() as a potential sleeper Chris Wilson
2017-11-09 11:57 ` Joonas Lahtinen [this message]
2017-11-09 12:02   ` Chris Wilson
2017-11-09 12:02 ` ✗ Fi.CI.BAT: warning for " Patchwork
2017-11-09 12:18   ` Chris Wilson

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=1510228635.6305.13.camel@linux.intel.com \
    --to=joonas.lahtinen@linux.intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=daniel.vetter@ffwll.ch \
    --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.