intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Robert Foss <robert.foss@collabora.com>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Stone <daniels@collabora.com>,
	intel-gfx@lists.freedesktop.org,
	Eric Engestrom <eric@engestrom.ch>,
	Gustavo Padovan <gustavo.padovan@collabora.com>
Subject: Re: [PATCH i-g-t v6 14/21] tests/sw_sync: Add subtest test_sync_expired_merge
Date: Thu, 17 Nov 2016 10:48:48 -0500	[thread overview]
Message-ID: <1479397728.2197.2.camel@collabora.com> (raw)
In-Reply-To: <20161117153953.GQ9241@nuc-i3427.alporthouse.com>

On Thu, 2016-11-17 at 15:39 +0000, Chris Wilson wrote:
> On Thu, Nov 17, 2016 at 10:02:02AM -0500, robert.foss@collabora.com
> wrote:
> > 
> > From: Rafael Antognolli <rafael.antognolli@intel.com>
> > 
> > This test creates an already expired fence, then creates a merged
> > fence
> > out of that expired one (passed twice to the merge operation), and
> > finally closes the merged fence. It shows that if the refcounts are
> > wrong on the original expired fence, it might get freed while still
> > in
> > use. Usually a kernel panick will follow.
> > 
> > Signed-off-by: Rafael Antognolli <rafael.antognolli@intel.com>
> > Signed-off-by: Robert Foss <robert.foss@collabora.com>
> > ---
> >  tests/sw_sync.c | 28 ++++++++++++++++++++++++++++
> >  1 file changed, 28 insertions(+)
> > 
> > diff --git a/tests/sw_sync.c b/tests/sw_sync.c
> > index 4e52f48..65416ad 100644
> > --- a/tests/sw_sync.c
> > +++ b/tests/sw_sync.c
> > @@ -582,6 +582,31 @@ static void
> > test_sync_multi_producer_single_consumer(void)
> >  		pthread_join(threads[i], NULL);
> >  }
> >  
> > +static void test_sync_expired_merge(void)
> > +{
> > +	int iterations = 1 << 20;
> > +	int timeline;
> > +	int i;
> > +	int fence_expired, fence_merged;
> > +
> > +	timeline = sw_sync_timeline_create();
> > +
> > +	sw_sync_timeline_inc(timeline, 100);
> > +	fence_expired = sw_sync_fence_create(timeline, 1);
> igt_assert(sync_wait(fence_expired, 0) == 1);
> or
> igt_assert(fence_signaled(fence_expired));
> 
> Both illustrative of the setup, and tests them.

Agreed, I'll add it for v7.

> 
> > 
> > +	fence_merged = sync_merge(fence_expired, fence_expired);
> > +	close(fence_merged);
> > +
> > +	for (i = 0; i < iterations; i++) {
> > +		int fence = sync_merge(fence_expired,
> > fence_expired);
> > +
> > +		igt_assert_f(sync_wait(fence, -1) == 0,
> > +				     "Failure waiting on
> > fence\n");
> > +		close(fence);
> Is the millionth iteration more likely to fail than iteration 0?
> 
> There's no change in code coverage, so is it worth the extra
> iterations?

I don't know if it is more likely to fail or not, which is why multiple
iterations are tested.

If you can tell me with certainty that multiple iterations always will
behave the same way I would be happy to remove the multiple iterations.

Granted, there are a few other tests that also do stress testing as a
part of what they test. So maybe this is redundant either way?
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2016-11-17 15:48 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-17 15:01 [PATCH i-g-t v6 00/21] Implement sw_sync test robert.foss
2016-11-17 15:01 ` [PATCH i-g-t v6 01/21] lib/sw_sync: Add helper functions for managing synchronization primitives robert.foss
2016-11-17 15:01 ` [PATCH i-g-t v6 02/21] tests/sw_sync: Add sw_sync test robert.foss
2016-11-17 15:52   ` Chris Wilson
2016-11-17 15:01 ` [PATCH i-g-t v6 03/21] tests/sw_sync: Add subtest test_alloc_fence robert.foss
2016-11-17 15:01 ` [PATCH i-g-t v6 04/21] tests/sw_sync: Add subtest test_alloc_fence_invalid_timeline robert.foss
2016-11-17 15:01 ` [PATCH i-g-t v6 05/21] tests/sw_sync: Add subtest test_alloc_merge_fence robert.foss
2016-11-17 15:01 ` [PATCH i-g-t v6 06/21] tests/sw_sync: Add subtest test_sync_busy robert.foss
2016-11-17 15:01 ` [PATCH i-g-t v6 07/21] tests/sw_sync: Add subtest test_sync_merge robert.foss
2016-11-17 15:48   ` Chris Wilson
2016-11-17 15:01 ` [PATCH i-g-t v6 08/21] tests/sw_sync: Add subtest test_sync_merge_same robert.foss
2016-11-17 16:00   ` Chris Wilson
2016-11-17 15:01 ` [PATCH i-g-t v6 09/21] tests/sw_sync: Add subtest test_sync_multi_consumer robert.foss
2016-11-17 15:01 ` [PATCH i-g-t v6 10/21] tests/sw_sync: Add subtest test_sync_multi_consumer_producer robert.foss
2016-11-17 15:01 ` [PATCH i-g-t v6 11/21] tests/sw_sync: Add subtest test_sync_random_merge robert.foss
2016-11-17 15:02 ` [PATCH i-g-t v6 12/21] tests/sw_sync: Add subtest test_sync_multi_timeline_wait robert.foss
2016-11-17 15:02 ` [PATCH i-g-t v6 13/21] tests/sw_sync: Add subtest test_sync_multi_producer_single_consumer robert.foss
2016-11-17 15:02 ` [PATCH i-g-t v6 14/21] tests/sw_sync: Add subtest test_sync_expired_merge robert.foss
2016-11-17 15:39   ` Chris Wilson
2016-11-17 15:48     ` Robert Foss [this message]
2016-11-17 15:02 ` [PATCH i-g-t v6 15/21] tests/sw_sync: Add subtest test_timeline_closed robert.foss
2016-11-17 15:02 ` [PATCH i-g-t v6 16/21] tests/sw_sync: Add subtest test_timeline_closed_signaled robert.foss
2016-11-17 15:02 ` [PATCH i-g-t v6 17/21] lib/sw_sync: Add igt_require_sw_sync to enable skipping on no sw_sync support robert.foss
2016-11-17 15:02 ` [PATCH i-g-t v6 18/21] tests/sw_sync: Add igt_require check for sw_sync feature robert.foss
2016-11-17 15:02 ` [PATCH i-g-t v6 19/21] tests/sw_sync: Add subtest test_sync_merge_invalid robert.foss
2016-11-17 15:52   ` Chris Wilson
2016-11-17 15:02 ` [PATCH i-g-t v6 20/21] tests/sw_sync: Add subtest test_sync_busy_fork robert.foss
2016-11-17 15:02 ` [PATCH i-g-t v6 21/21] tests/sw_sync: Add subtest test_sync_busy_unixsocket robert.foss
  -- strict thread matches above, loose matches on Subject: below --
2016-11-18 14:59 [PATCH i-g-t v6 00/21] Implement sw_sync test robert.foss
2016-11-18 15:00 ` [PATCH i-g-t v6 14/21] tests/sw_sync: Add subtest test_sync_expired_merge robert.foss

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=1479397728.2197.2.camel@collabora.com \
    --to=robert.foss@collabora.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=daniels@collabora.com \
    --cc=eric@engestrom.ch \
    --cc=gustavo.padovan@collabora.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).