public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] tests/gem_flink_race, prime_self_import: fix object counts
Date: Wed, 7 May 2014 16:13:39 +0200	[thread overview]
Message-ID: <20140507141339.GV5730@phenom.ffwll.local> (raw)
In-Reply-To: <1399470928-15389-1-git-send-email-mika.kuoppala@intel.com>

On Wed, May 07, 2014 at 04:55:28PM +0300, Mika Kuoppala wrote:
> We need to add one drm_open_any() before getting the object counts
> as first call to drm_open_any() allocates file descriptors for
> exit handlers and thus is not symmetrical
> 
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77867
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77875
> Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>

Ah, makes sense. Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

When you push this please add a citation of the commit which introduced
this regression like we do it for kernel patches.

Thanks, Daniel

> ---
>  tests/gem_flink_race.c    |    8 ++++++++
>  tests/prime_self_import.c |    8 ++++++++
>  2 files changed, 16 insertions(+)
> 
> diff --git a/tests/gem_flink_race.c b/tests/gem_flink_race.c
> index 3353b83..f129cb3 100644
> --- a/tests/gem_flink_race.c
> +++ b/tests/gem_flink_race.c
> @@ -163,6 +163,11 @@ static void test_flink_close(void)
>  	int r, i, num_threads;
>  	int obj_count;
>  	void *status;
> +	int fake;
> +
> +	/* Allocate exit handler fds in here so that we dont screw
> +	 * up the counts */
> +	fake = drm_open_any();
>  
>  	obj_count = get_object_count();
>  
> @@ -193,6 +198,9 @@ static void test_flink_close(void)
>  	obj_count = get_object_count() - obj_count;
>  
>  	printf("leaked %i objects\n", obj_count);
> +
> +	close(fake);
> +
>  	igt_assert(obj_count == 0);
>  }
>  
> diff --git a/tests/prime_self_import.c b/tests/prime_self_import.c
> index efdd24f..41c203f 100644
> --- a/tests/prime_self_import.c
> +++ b/tests/prime_self_import.c
> @@ -258,6 +258,11 @@ static void test_reimport_close_race(void)
>  	int obj_count;
>  	void *status;
>  	uint32_t handle;
> +	int fake;
> +
> +	/* Allocate exit handler fds in here so that we dont screw
> +	 * up the counts */
> +	fake = drm_open_any();
>  
>  	obj_count = get_object_count();
>  
> @@ -294,6 +299,9 @@ static void test_reimport_close_race(void)
>  	obj_count = get_object_count() - obj_count;
>  
>  	printf("leaked %i objects\n", obj_count);
> +
> +	close(fake);
> +
>  	igt_assert(obj_count == 0);
>  }
>  
> -- 
> 1.7.9.5
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

      reply	other threads:[~2014-05-07 14:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-07 13:55 [PATCH] tests/gem_flink_race, prime_self_import: fix object counts Mika Kuoppala
2014-05-07 14:13 ` Daniel Vetter [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=20140507141339.GV5730@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=mika.kuoppala@linux.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