All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mika Kuoppala <mika.kuoppala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Cc: igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t] drm/drm_import_export: Replace imprecise loop-bound with timeout
Date: Wed, 16 Jan 2019 15:56:32 +0200	[thread overview]
Message-ID: <87imyoyacv.fsf@gaia.fi.intel.com> (raw)
In-Reply-To: <20190116131131.29704-1-chris@chris-wilson.co.uk>

Chris Wilson <chris@chris-wilson.co.uk> writes:

> Use a specific timeout to exercise the race conditions, rather than a
> number of tries -- this prevents it burning up too many minutes under CI
> for little gain, we can just run it again to improve race detection.
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108667
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> ---
>  tests/drm_import_export.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/tests/drm_import_export.c b/tests/drm_import_export.c
> index e3ce2480c..4bc7b7d4b 100644
> --- a/tests/drm_import_export.c
> +++ b/tests/drm_import_export.c
> @@ -129,8 +129,6 @@ static void * test_thread(void * par)
>  	return NULL;
>  }
>  
> -#define IMPORT_RACE_LOOPS 100000
> -
>  struct import_race_thread_data {
>  	int prime_fd;
>  	uint32_t flink_name;
> @@ -189,7 +187,6 @@ static void *import_close_thread(void *data)
>  static void test_import_close_race(void)
>  {
>  	pthread_t t;
> -	unsigned int loops = IMPORT_RACE_LOOPS;
>  	drm_intel_bo *bo;
>  	struct import_race_thread_data t_data;
>  
> @@ -199,7 +196,7 @@ static void test_import_close_race(void)
>  
>  	igt_assert_eq(pthread_create(&t, NULL, import_close_thread , &t_data), 0);
>  
> -	while (loops--) {
> +	igt_until_timeout(15) {

Reasonable. Took 90s with kbl!
Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>

>  		bo = drm_intel_bo_alloc(bufmgr, "buf-shared", 4096, 4096);
>  		igt_assert(bo != NULL);
>  		/*
> -- 
> 2.20.1
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

WARNING: multiple messages have this Message-ID (diff)
From: Mika Kuoppala <mika.kuoppala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Cc: igt-dev@lists.freedesktop.org
Subject: Re: [PATCH i-g-t] drm/drm_import_export: Replace imprecise loop-bound with timeout
Date: Wed, 16 Jan 2019 15:56:32 +0200	[thread overview]
Message-ID: <87imyoyacv.fsf@gaia.fi.intel.com> (raw)
In-Reply-To: <20190116131131.29704-1-chris@chris-wilson.co.uk>

Chris Wilson <chris@chris-wilson.co.uk> writes:

> Use a specific timeout to exercise the race conditions, rather than a
> number of tries -- this prevents it burning up too many minutes under CI
> for little gain, we can just run it again to improve race detection.
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108667
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> ---
>  tests/drm_import_export.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/tests/drm_import_export.c b/tests/drm_import_export.c
> index e3ce2480c..4bc7b7d4b 100644
> --- a/tests/drm_import_export.c
> +++ b/tests/drm_import_export.c
> @@ -129,8 +129,6 @@ static void * test_thread(void * par)
>  	return NULL;
>  }
>  
> -#define IMPORT_RACE_LOOPS 100000
> -
>  struct import_race_thread_data {
>  	int prime_fd;
>  	uint32_t flink_name;
> @@ -189,7 +187,6 @@ static void *import_close_thread(void *data)
>  static void test_import_close_race(void)
>  {
>  	pthread_t t;
> -	unsigned int loops = IMPORT_RACE_LOOPS;
>  	drm_intel_bo *bo;
>  	struct import_race_thread_data t_data;
>  
> @@ -199,7 +196,7 @@ static void test_import_close_race(void)
>  
>  	igt_assert_eq(pthread_create(&t, NULL, import_close_thread , &t_data), 0);
>  
> -	while (loops--) {
> +	igt_until_timeout(15) {

Reasonable. Took 90s with kbl!
Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>

>  		bo = drm_intel_bo_alloc(bufmgr, "buf-shared", 4096, 4096);
>  		igt_assert(bo != NULL);
>  		/*
> -- 
> 2.20.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2019-01-16 13:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-16 13:11 [igt-dev] [PATCH i-g-t] drm/drm_import_export: Replace imprecise loop-bound with timeout Chris Wilson
2019-01-16 13:11 ` Chris Wilson
2019-01-16 13:30 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2019-01-16 13:56 ` Mika Kuoppala [this message]
2019-01-16 13:56   ` [PATCH i-g-t] " Mika Kuoppala
2019-01-16 22:54 ` [igt-dev] ✓ Fi.CI.IGT: success for " 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=87imyoyacv.fsf@gaia.fi.intel.com \
    --to=mika.kuoppala@linux.intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=igt-dev@lists.freedesktop.org \
    --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.