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/selftest: If reconfigure_sseu is busy, try again
Date: Tue, 26 Nov 2019 17:11:04 +0000 [thread overview]
Message-ID: <b6b3cdb0-cb2b-e25c-27f2-296405e2f944@linux.intel.com> (raw)
In-Reply-To: <6f599b6e-1011-2b96-f171-a624a466dc9d@linux.intel.com>
On 26/11/2019 17:08, Tvrtko Ursulin wrote:
>
> On 26/11/2019 17:05, Chris Wilson wrote:
>> Quoting Tvrtko Ursulin (2019-11-26 17:00:53)
>>>
>>> On 26/11/2019 16:47, Chris Wilson wrote:
>>>> Following 58b4c1a07ada ("drm/i915: Reduce nested
>>>> prepare_remote_context()
>>>> to a trylock"), we punt to the caller if the local intel_context
>>>> happens to be busy as we try to rewrite the sseu (due to retiring in
>>>> another thread). As the interlude should be short, spin until the lock
>>>> is available.
>>>>
>>>> The regret for using mutex_trylock() and not an atomic insertion of the
>>>> barrier is growing...
>>>>
>>>> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
>>>> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>>>> ---
>>>> drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c | 5 ++++-
>>>> 1 file changed, 4 insertions(+), 1 deletion(-)
>>>>
>>>> diff --git a/drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c
>>>> b/drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c
>>>> index 2ea4790f3721..571cc996577c 100644
>>>> --- a/drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c
>>>> +++ b/drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c
>>>> @@ -1197,7 +1197,10 @@ __sseu_test(const char *name,
>>>> if (ret)
>>>> goto out_pm;
>>>> - ret = intel_context_reconfigure_sseu(ce, sseu);
>>>> + do {
>>>> + ret = intel_context_reconfigure_sseu(ce, sseu);
>>>> + cond_resched();
>>>> + } while (ret == -EAGAIN);
>>>> if (ret)
>>>> goto out_spin;
>>>>
>>>
>>> Hm I looked at the selftests, saw error is correctly propagated, and
>>> concluded it will be fine. I missed the problem selftests will not
>>> actually retry. But wait, can we even count that userspace will if all
>>> of a sudden ctx.set_param starts returning -EAGAIN sporadically? Feels
>>> like we may need to revert.
>>
>> We invoke the principle of drmIoctl() catches -EAGAIN.
>
> I'm not comfortable with that. :( Not least how we are saying not to use
> libdrm. man 2 ioctl does not mention -EAGAIN. :(
Or duct tape by looping in set_sseu as well?
Regards,
Tvrtko
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
WARNING: multiple messages have this Message-ID (diff)
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH] drm/i915/selftest: If reconfigure_sseu is busy, try again
Date: Tue, 26 Nov 2019 17:11:04 +0000 [thread overview]
Message-ID: <b6b3cdb0-cb2b-e25c-27f2-296405e2f944@linux.intel.com> (raw)
Message-ID: <20191126171104.Iz5yddrXM3zukrvEuQa-LiZWdoTj43Y2NT-IzoOYLXQ@z> (raw)
In-Reply-To: <6f599b6e-1011-2b96-f171-a624a466dc9d@linux.intel.com>
On 26/11/2019 17:08, Tvrtko Ursulin wrote:
>
> On 26/11/2019 17:05, Chris Wilson wrote:
>> Quoting Tvrtko Ursulin (2019-11-26 17:00:53)
>>>
>>> On 26/11/2019 16:47, Chris Wilson wrote:
>>>> Following 58b4c1a07ada ("drm/i915: Reduce nested
>>>> prepare_remote_context()
>>>> to a trylock"), we punt to the caller if the local intel_context
>>>> happens to be busy as we try to rewrite the sseu (due to retiring in
>>>> another thread). As the interlude should be short, spin until the lock
>>>> is available.
>>>>
>>>> The regret for using mutex_trylock() and not an atomic insertion of the
>>>> barrier is growing...
>>>>
>>>> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
>>>> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>>>> ---
>>>> drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c | 5 ++++-
>>>> 1 file changed, 4 insertions(+), 1 deletion(-)
>>>>
>>>> diff --git a/drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c
>>>> b/drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c
>>>> index 2ea4790f3721..571cc996577c 100644
>>>> --- a/drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c
>>>> +++ b/drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c
>>>> @@ -1197,7 +1197,10 @@ __sseu_test(const char *name,
>>>> if (ret)
>>>> goto out_pm;
>>>> - ret = intel_context_reconfigure_sseu(ce, sseu);
>>>> + do {
>>>> + ret = intel_context_reconfigure_sseu(ce, sseu);
>>>> + cond_resched();
>>>> + } while (ret == -EAGAIN);
>>>> if (ret)
>>>> goto out_spin;
>>>>
>>>
>>> Hm I looked at the selftests, saw error is correctly propagated, and
>>> concluded it will be fine. I missed the problem selftests will not
>>> actually retry. But wait, can we even count that userspace will if all
>>> of a sudden ctx.set_param starts returning -EAGAIN sporadically? Feels
>>> like we may need to revert.
>>
>> We invoke the principle of drmIoctl() catches -EAGAIN.
>
> I'm not comfortable with that. :( Not least how we are saying not to use
> libdrm. man 2 ioctl does not mention -EAGAIN. :(
Or duct tape by looping in set_sseu as well?
Regards,
Tvrtko
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2019-11-26 17:11 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-26 16:47 [PATCH] drm/i915/selftest: If reconfigure_sseu is busy, try again Chris Wilson
2019-11-26 16:47 ` [Intel-gfx] " Chris Wilson
2019-11-26 17:00 ` Tvrtko Ursulin
2019-11-26 17:00 ` [Intel-gfx] " Tvrtko Ursulin
2019-11-26 17:05 ` Chris Wilson
2019-11-26 17:05 ` [Intel-gfx] " Chris Wilson
2019-11-26 17:08 ` Tvrtko Ursulin
2019-11-26 17:08 ` [Intel-gfx] " Tvrtko Ursulin
2019-11-26 17:11 ` Tvrtko Ursulin [this message]
2019-11-26 17:11 ` Tvrtko Ursulin
2019-11-26 17:19 ` Chris Wilson
2019-11-26 17:19 ` [Intel-gfx] " Chris Wilson
2019-11-26 21:02 ` ✗ Fi.CI.BUILD: failure for drm/i915/selftest: If reconfigure_sseu is busy, try again (rev2) Patchwork
2019-11-26 21:02 ` [Intel-gfx] " 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=b6b3cdb0-cb2b-e25c-27f2-296405e2f944@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 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.