From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: Check the target has not already completed before waiting on it
Date: Tue, 7 May 2019 11:34:28 +0100 [thread overview]
Message-ID: <822fe5cf-ab26-2b01-dc14-e5b6b5915a72@linux.intel.com> (raw)
In-Reply-To: <20190503135229.32039-1-chris@chris-wilson.co.uk>
On 03/05/2019 14:52, Chris Wilson wrote:
> When we want to wait for a request to be executed, we first ask if it is
> not on the GPU as if it's on the gpu, there's no need to wait. However,
> we have to take into account that a request may not be on the GPU
> because it has already completed!
>
> The window is small due to the numerous preceding checks that our target
> has not yet completed, yet there is still a very small window across the
> kmalloc.
>
> Fixes: e88619646971 ("drm/i915: Use HW semaphores for inter-engine synchronisation on gen8+")
> Testcase: igt/gem_concurrent_blit
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> ---
> drivers/gpu/drm/i915/i915_request.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_request.c b/drivers/gpu/drm/i915/i915_request.c
> index d06c45305b03..6dbf8dc5cd6a 100644
> --- a/drivers/gpu/drm/i915/i915_request.c
> +++ b/drivers/gpu/drm/i915/i915_request.c
> @@ -373,7 +373,7 @@ i915_request_await_execution(struct i915_request *rq,
> init_irq_work(&cb->work, irq_execute_cb);
>
> spin_lock_irq(&signal->lock);
> - if (i915_request_is_active(signal)) {
> + if (i915_request_is_active(signal) || i915_request_completed(signal)) {
> i915_sw_fence_complete(cb->fence);
> kmem_cache_free(global.slab_execute_cbs, cb);
> } else {
>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Regards,
Tvrtko
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
prev parent reply other threads:[~2019-05-07 10:34 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-03 13:52 [PATCH] drm/i915: Check the target has not already completed before waiting on it Chris Wilson
2019-05-03 14:29 ` Chris Wilson
2019-05-03 14:57 ` ✓ Fi.CI.BAT: success for " Patchwork
2019-05-03 17:47 ` ✓ Fi.CI.IGT: " Patchwork
2019-05-07 10:34 ` Tvrtko Ursulin [this message]
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=822fe5cf-ab26-2b01-dc14-e5b6b5915a72@linux.intel.com \
--to=tvrtko.ursulin@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox