Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Nirmoy Das <nirmoy.das@intel.com>
To: Krzysztof Niemiec <krzysztof.niemiec@intel.com>,
	<igt-dev@lists.freedesktop.org>
Cc: Chris Wilson <chris.p.wilson@linux.intel.com>
Subject: Re: [PATCH i-g-t v2] tests/intel/gem_ctx_persistence: Wait for context termination
Date: Tue, 19 Nov 2024 13:15:58 +0100	[thread overview]
Message-ID: <b5d2ff5f-b7ae-4425-9798-18201c8ed9f9@intel.com> (raw)
In-Reply-To: <20241118121657.10624-2-krzysztof.niemiec@intel.com>


On 11/18/2024 1:16 PM, Krzysztof Niemiec wrote:
> In some of the subtests, there is a race condition - if a non-persistent
> context is not terminated by the driver before the associated spinner is
> ended and probed for status, the status will be incorrectly reported as
> completed.
>
> Add a sleep instruction before the assert to give the kernel time to
> clean up.
>
> v2:
>  - Update the patch description,
>  - Change the previous expression to a simpler usleep(),
>  - Add a usleep() call in test_saturated_hostile_all(), as this behavior
>    is also shown in this subtest.
>
> Signed-off-by: Krzysztof Niemiec <krzysztof.niemiec@intel.com>
Reviewed-by: Nirmoy Das <nirmoy.das@intel.com>
> ---
>  tests/intel/gem_ctx_persistence.c | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/tests/intel/gem_ctx_persistence.c b/tests/intel/gem_ctx_persistence.c
> index 974444cf1..d90b78267 100644
> --- a/tests/intel/gem_ctx_persistence.c
> +++ b/tests/intel/gem_ctx_persistence.c
> @@ -1029,6 +1029,9 @@ test_saturated_hostile_all(int i915, const intel_ctx_t *base_ctx,
>  	igt_spin_busywait_until_started(spin);
>  	intel_ctx_destroy(i915, ctx);
>  
> +	/* Give the kernel some time to terminate the context */
> +	usleep(reset_timeout_ms * 1000);
> +
>  	/* Hostile request requires a GPU reset to terminate */
>  	igt_assert_eq(wait_for_status(spin->out_fence, reset_timeout_ms), -EIO);
>  
> @@ -1173,6 +1176,9 @@ static void __smoker(int i915, const intel_ctx_cfg_t *cfg,
>  	drm_close_driver(fd);
>  	flush_delayed_fput(i915);
>  
> +	/* Give the kernel some time to terminate the context */
> +	usleep(reset_timeout_ms * 1000);
> +
>  	igt_spin_end(spin);
>  
>  	igt_assert_eq(wait_for_status(spin->out_fence, timeout), expected);

  parent reply	other threads:[~2024-11-19 12:16 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-18 12:16 [PATCH i-g-t v2] tests/intel/gem_ctx_persistence: Wait for context termination Krzysztof Niemiec
2024-11-19  1:09 ` ✓ CI.xeBAT: success for tests/intel/gem_ctx_persistence: Wait for context termination (rev3) Patchwork
2024-11-19  1:20 ` ✗ Fi.CI.BAT: failure " Patchwork
2024-11-20  9:56   ` Krzysztof Niemiec
2024-11-19 12:15 ` Nirmoy Das [this message]
2024-11-19 12:25 ` ✗ CI.xeFULL: " Patchwork
2024-11-20  9:58   ` Krzysztof Niemiec

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=b5d2ff5f-b7ae-4425-9798-18201c8ed9f9@intel.com \
    --to=nirmoy.das@intel.com \
    --cc=chris.p.wilson@linux.intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=krzysztof.niemiec@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