Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: "Morton, Derek J" <derek.j.morton@intel.com>
Cc: "intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>,
	"Wood, Thomas" <thomas.wood@intel.com>
Subject: Re: [PATCH i-g-t] gem_flink_race/prime_self_import: Improve test reliability
Date: Thu, 10 Dec 2015 13:52:53 +0100	[thread overview]
Message-ID: <20151210125253.GW20822@phenom.ffwll.local> (raw)
In-Reply-To: <2D016F5BA44C744783BA96B1D3EBC5BD13ED6293@IRSMSX102.ger.corp.intel.com>

On Thu, Dec 10, 2015 at 11:51:29AM +0000, Morton, Derek J wrote:
> >
> >
> >-----Original Message-----
> >From: Daniel Vetter [mailto:daniel.vetter@ffwll.ch] On Behalf Of Daniel Vetter
> >Sent: Thursday, December 10, 2015 10:13 AM
> >To: Morton, Derek J
> >Cc: intel-gfx@lists.freedesktop.org; Wood, Thomas
> >Subject: Re: [Intel-gfx] [PATCH i-g-t] gem_flink_race/prime_self_import: Improve test reliability
> >
> >On Tue, Dec 08, 2015 at 12:44:44PM +0000, Derek Morton wrote:
> >> gem_flink_race and prime_self_import have subtests which read the 
> >> number of open gem objects from debugfs to determine if objects have 
> >> leaked during the test. However the test can fail sporadically if the 
> >> number of gem objects changes due to other process activity.
> >> This patch introduces a change to check the number of gem objects 
> >> several times to filter out any fluctuations.
> >
> >Why exactly does this happen? IGT tests should be run on bare metal,
> >with everything else killed/subdued/shutup. If there's still things
> >going on that create objects, we need to stop them from doing that.
> >
> >If this only applies to Android, or some special Android deamon them
> >imo check for that at runtime and igt_skip("your setup is invalid,
> >deamon %s running\n"); is the correct fix. After all just because you
> >sampled for a bit doesn't mean that it wont still change right when you
> >start running the test for real, so this is still fragile.
> 
> Before running tests on android we do stop everything possible. I
> suspect the culprit is coreu getting automatically restarted after it is
> stopped. I had additional debug while developing this patch and what I
> saw was the system being mostly quiescent but with some very low level
> background activity. 1 extra object being created and then deleted
> occasionally. Depending on whether it occurred at the start or end of
> the test it was resulting in a reported leak of either 1 or -1 objects.
> The patch fixes that issue by taking several samples and requiring them
> to be the same, therefore filtering out the low level background noise.
> It would not help if something in the background allocated an object and
> kept it allocated, but I have not seen that happen. I only saw once the
> object count increasing for 2 consecutive reads hence the count to 4 to
> give a margin. The test was failing about 10%. With this patch I got
> 100% pass across 300 runs of each of the tests.

Hm, piglit checks that there's no other drm clients running. Have you
tried re-running that check to zero in on the culprit?

> If you are concerned about the behaviour when running the test with a
> load of background activity I could add code to limit to the reset of
> the count and fail the test in that instance. That would give a benefit
> of distinguishing a test fail due to excessive background activity from
> a detected leak.

I'm also concerned for the overhead this causes everyone else. If this
really is some Android trouble then I think it'd be good to only compile
this on Android. But would still be much better if you can get to a
reliably clean test environment.

> I would not want to just have the test skip as that introduces a hole in
> our test coverage.
> 
> >Also would be good to extract get_stable_obj_count to a proper igt
> >library function, if it indeed needs to be this tricky. And then add
> >the explanation for why we need this in the gtkdoc.
> 
> I  can move the code to an igt library. Which library would you suggest? Igt_debugfs ?

Hm yeah, it's a bit the dumping ground for all things debugfs access ;-)
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2015-12-10 12:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-08 12:44 [PATCH i-g-t] gem_flink_race/prime_self_import: Improve test reliability Derek Morton
2015-12-10 10:13 ` Daniel Vetter
2015-12-10 11:51   ` Morton, Derek J
2015-12-10 12:52     ` Daniel Vetter [this message]
2015-12-11 10:33       ` Morton, Derek J
2015-12-11 17:06         ` Daniel Vetter
2015-12-14  9:38           ` Morton, Derek J

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=20151210125253.GW20822@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=derek.j.morton@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=thomas.wood@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