All of lore.kernel.org
 help / color / mirror / Atom feed
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/selftests: Disable preemption while setting up fence-timers
Date: Thu, 14 Mar 2019 11:37:19 +0000	[thread overview]
Message-ID: <71f08352-390f-cfe1-712d-1dd8ebf3e59e@linux.intel.com> (raw)
In-Reply-To: <20190313205944.5768-1-chris@chris-wilson.co.uk>


On 13/03/2019 20:59, Chris Wilson wrote:
> The impossible happens and a future fence expired while we were still
> initialising. The probable cause is that the test was preempted and we
> lost our scheduler cpu slice. Disable preemption during this test to
> rule out preemption as a source of timer disruption.
> 
> References: https://bugs.freedesktop.org/show_bug.cgi?id=110039
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> ---
>   drivers/gpu/drm/i915/selftests/i915_sw_fence.c | 9 ++++++++-
>   1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/selftests/i915_sw_fence.c b/drivers/gpu/drm/i915/selftests/i915_sw_fence.c
> index cdbc8f134e5e..cbf45d85cbff 100644
> --- a/drivers/gpu/drm/i915/selftests/i915_sw_fence.c
> +++ b/drivers/gpu/drm/i915/selftests/i915_sw_fence.c
> @@ -571,21 +571,27 @@ static int test_timer(void *arg)
>   	unsigned long target, delay;
>   	struct timed_fence tf;
>   
> +	preempt_disable();
>   	timed_fence_init(&tf, target = jiffies);
>   	if (!i915_sw_fence_done(&tf.fence)) {
>   		pr_err("Fence with immediate expiration not signaled\n");
>   		goto err;
>   	}
> +	preempt_enable();
>   	timed_fence_fini(&tf);
>   
>   	for_each_prime_number(delay, i915_selftest.timeout_jiffies/2) {
> +		preempt_disable();
>   		timed_fence_init(&tf, target = jiffies + delay);
>   		if (i915_sw_fence_done(&tf.fence)) {
>   			pr_err("Fence with future expiration (%lu jiffies) already signaled\n", delay);
>   			goto err;
>   		}
> +		preempt_enable();
>   
>   		i915_sw_fence_wait(&tf.fence);
> +
> +		preempt_disable();
>   		if (!i915_sw_fence_done(&tf.fence)) {
>   			pr_err("Fence not signaled after wait\n");
>   			goto err;
> @@ -595,13 +601,14 @@ static int test_timer(void *arg)
>   			       target, jiffies);
>   			goto err;
>   		}
> -
> +		preempt_enable();
>   		timed_fence_fini(&tf);
>   	}
>   
>   	return 0;
>   
>   err:
> +	preempt_enable();
>   	timed_fence_fini(&tf);
>   	return -EINVAL;
>   }
> 

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

  parent reply	other threads:[~2019-03-14 11:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-13 20:59 [PATCH] drm/i915/selftests: Disable preemption while setting up fence-timers Chris Wilson
2019-03-14  2:22 ` ✓ Fi.CI.BAT: success for " Patchwork
2019-03-14  8:38 ` ✓ Fi.CI.IGT: " Patchwork
2019-03-14 11:37 ` Tvrtko Ursulin [this message]
2019-03-14 11:50   ` [PATCH] " 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=71f08352-390f-cfe1-712d-1dd8ebf3e59e@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.