From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Matthew Brost <matthew.brost@intel.com>,
intel-gfx@lists.freedesktop.org,
dri-devel@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH] drm/i915: Lock timeline mutex directly in error path of eb_pin_timeline
Date: Wed, 5 Jan 2022 09:35:44 +0000 [thread overview]
Message-ID: <3ae7e493-4b77-9e87-ca6f-34f85cab4ecb@linux.intel.com> (raw)
In-Reply-To: <20220104233056.11245-1-matthew.brost@intel.com>
On 04/01/2022 23:30, Matthew Brost wrote:
> Don't use the interruptable version of the timeline mutex lock in the
interruptible
> error path of eb_pin_timeline as the cleanup must always happen.
>
> v2:
> (John Harrison)
> - Don't check for interrupt during mutex lock
>
> Fixes: 544460c33821 ("drm/i915: Multi-BB execbuf")
> Signed-off-by: Matthew Brost <matthew.brost@intel.com>
> ---
> drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
> index e9541244027a..e96e133cbb1f 100644
> --- a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
> +++ b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
> @@ -2516,9 +2516,9 @@ static int eb_pin_timeline(struct i915_execbuffer *eb, struct intel_context *ce,
> timeout) < 0) {
> i915_request_put(rq);
>
> - tl = intel_context_timeline_lock(ce);
> + mutex_lock(&ce->timeline->mutex);
On the other hand it is more user friendly to handle signals (which
maybe does not matter in this case, not sure any longer how long hold
time it can have) but there is also a question of consistency within the
very function you are changing.
Apart from consistency, what about the parent-child magic
intel_context_timeline_lock does and you wouldn't have here?
And what about the very existence of intel_context_timeline_lock as a
component boundary separation API, if it is used inconsistently
throughout i915_gem_execbuffer.c?
Regards,
Tvrtko
> intel_context_exit(ce);
> - intel_context_timeline_unlock(tl);
> + mutex_unlock(&ce->timeline->mutex);
>
> if (nonblock)
> return -EWOULDBLOCK;
>
next prev parent reply other threads:[~2022-01-05 9:35 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-04 23:30 [PATCH] drm/i915: Lock timeline mutex directly in error path of eb_pin_timeline Matthew Brost
2022-01-05 9:35 ` Tvrtko Ursulin [this message]
2022-01-05 16:24 ` [Intel-gfx] " Matthew Brost
2022-01-06 9:56 ` Tvrtko Ursulin
2022-01-06 16:18 ` Matthew Brost
2022-01-06 16:51 ` Tvrtko Ursulin
2022-01-06 16:52 ` Matthew Brost
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=3ae7e493-4b77-9e87-ca6f-34f85cab4ecb@linux.intel.com \
--to=tvrtko.ursulin@linux.intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=matthew.brost@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox