All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH igt] igt/gem_flink_race: Limit name subtest to 5s
@ 2017-08-30 10:13 Chris Wilson
  2017-08-30 10:31 ` ✓ Fi.CI.BAT: success for " Patchwork
  2017-08-30 11:35 ` ✓ Fi.CI.IGT: " Patchwork
  0 siblings, 2 replies; 3+ messages in thread
From: Chris Wilson @ 2017-08-30 10:13 UTC (permalink / raw)
  To: intel-gfx

At present, we try to do 1,000,000 cycles, which may be a reasonable
estimate for detecting the race, takes 6 minutes in practice on bxt on a
good day (as it spends more time doing rpm suspend/resume than actual work,
and that accounts for more of the relative difference in performance
between bxt and big core than the difference in clocks+ipc).

An ideal solution would be to have a data-race detector in the kernel
combined with a short test to exercise the different paths. Lacking the
DRD, use a shorter test anyway. 5s is chosen simply on the basis that
the other race subtest is also run over a 5s interval.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 tests/gem_flink_race.c | 35 +++++++++++++++++++++++++----------
 1 file changed, 25 insertions(+), 10 deletions(-)

diff --git a/tests/gem_flink_race.c b/tests/gem_flink_race.c
index 30e33f65..baee285f 100644
--- a/tests/gem_flink_race.c
+++ b/tests/gem_flink_race.c
@@ -49,8 +49,14 @@ IGT_TEST_DESCRIPTION("Check for flink/open vs. gem close races.");
 volatile int pls_die = 0;
 int fd;
 
+struct flink_name {
+	pthread_t thread;
+	unsigned long count;
+};
+
 static void *thread_fn_flink_name(void *p)
 {
+	struct flink_name *t = p;
 	struct drm_gem_open open_struct;
 	int ret;
 
@@ -65,6 +71,7 @@ static void *thread_fn_flink_name(void *p)
 			igt_assert(name == 1);
 
 			gem_close(fd, open_struct.handle);
+			t->count++;
 		} else
 			igt_assert(errno == ENOENT);
 	}
@@ -72,42 +79,50 @@ static void *thread_fn_flink_name(void *p)
 	return (void *)0;
 }
 
-static void test_flink_name(void)
+static void test_flink_name(int timeout)
 {
-	pthread_t *threads;
+	struct flink_name *threads;
 	int r, i, num_threads;
+	unsigned long count;
+	char buf[256];
 	void *status;
+	int len;
 
 	num_threads = sysconf(_SC_NPROCESSORS_ONLN) - 1;
 	if (!num_threads)
 		num_threads = 1;
 
-	threads = calloc(num_threads, sizeof(pthread_t));
+	threads = calloc(num_threads, sizeof(*threads));
 
 	fd = drm_open_driver(DRIVER_INTEL);
 
 	for (i = 0; i < num_threads; i++) {
-		r = pthread_create(&threads[i], NULL,
-				   thread_fn_flink_name, NULL);
+		r = pthread_create(&threads[i].thread, NULL,
+				   thread_fn_flink_name, &threads[i]);
 		igt_assert_eq(r, 0);
 	}
 
-	for (i = 0; i < 1000000; i++) {
+	count = 0;
+	igt_until_timeout(timeout) {
 		uint32_t handle;
 
 		handle = gem_create(fd, 4096);
-
 		gem_flink(fd, handle);
-
 		gem_close(fd, handle);
+
+		count++;
 	}
 
 	pls_die = 1;
 
+	len = snprintf(buf, sizeof(buf), "Completed %lu cycles with [", count);
 	for (i = 0;  i < num_threads; i++) {
-		pthread_join(threads[i], &status);
+		pthread_join(threads[i].thread, &status);
 		igt_assert(status == 0);
+		len += snprintf(buf + len, sizeof(buf) - len, "%lu, ", threads[i].count);
 	}
+	snprintf(buf + len - 2, sizeof(buf) - len + 2, "] races");
+	igt_info("%s\n", buf);
 
 	close(fd);
 }
@@ -186,7 +201,7 @@ igt_main
 	igt_skip_on_simulation();
 
 	igt_subtest("flink_name")
-		test_flink_name();
+		test_flink_name(5);
 
 	igt_subtest("flink_close")
 		test_flink_close();
-- 
2.14.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* ✓ Fi.CI.BAT: success for igt/gem_flink_race: Limit name subtest to 5s
  2017-08-30 10:13 [PATCH igt] igt/gem_flink_race: Limit name subtest to 5s Chris Wilson
@ 2017-08-30 10:31 ` Patchwork
  2017-08-30 11:35 ` ✓ Fi.CI.IGT: " Patchwork
  1 sibling, 0 replies; 3+ messages in thread
From: Patchwork @ 2017-08-30 10:31 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: igt/gem_flink_race: Limit name subtest to 5s
URL   : https://patchwork.freedesktop.org/series/29528/
State : success

== Summary ==

IGT patchset tested on top of latest successful build
bf45d253648250fc402eee02237366c8882b2053 igt: Add gem_close

with latest DRM-Tip kernel build CI_DRM_3018
6a305b78140a drm-tip: 2017y-08m-30d-08h-12m-34s UTC integration manifest

Test kms_cursor_legacy:
        Subgroup basic-busy-flip-before-cursor-atomic:
                pass       -> FAIL       (fi-snb-2600) fdo#100215
Test kms_flip:
        Subgroup basic-flip-vs-modeset:
                pass       -> SKIP       (fi-skl-x1585l) fdo#101781

fdo#100215 https://bugs.freedesktop.org/show_bug.cgi?id=100215
fdo#101781 https://bugs.freedesktop.org/show_bug.cgi?id=101781

fi-bdw-5557u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:11  time:457s
fi-bdw-gvtdvm    total:288  pass:265  dwarn:0   dfail:0   fail:0   skip:14  time:443s
fi-blb-e6850     total:288  pass:224  dwarn:1   dfail:0   fail:0   skip:54  time:363s
fi-bsw-n3050     total:288  pass:243  dwarn:0   dfail:0   fail:0   skip:36  time:560s
fi-bwr-2160      total:288  pass:184  dwarn:0   dfail:0   fail:0   skip:95  time:252s
fi-bxt-j4205     total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:19  time:521s
fi-byt-j1900     total:288  pass:254  dwarn:1   dfail:0   fail:0   skip:24  time:518s
fi-byt-n2820     total:288  pass:250  dwarn:1   dfail:0   fail:0   skip:28  time:514s
fi-elk-e7500     total:288  pass:230  dwarn:0   dfail:0   fail:0   skip:49  time:437s
fi-glk-2a        total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:19  time:614s
fi-hsw-4770      total:288  pass:263  dwarn:0   dfail:0   fail:0   skip:16  time:448s
fi-hsw-4770r     total:288  pass:263  dwarn:0   dfail:0   fail:0   skip:16  time:426s
fi-ilk-650       total:288  pass:229  dwarn:0   dfail:0   fail:0   skip:50  time:426s
fi-ivb-3520m     total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:18  time:504s
fi-ivb-3770      total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:18  time:475s
fi-kbl-7500u     total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:18  time:481s
fi-kbl-7560u     total:288  pass:269  dwarn:0   dfail:0   fail:0   skip:10  time:599s
fi-kbl-r         total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:18  time:599s
fi-skl-6260u     total:288  pass:269  dwarn:0   dfail:0   fail:0   skip:10  time:467s
fi-skl-6770hq    total:288  pass:269  dwarn:0   dfail:0   fail:0   skip:10  time:489s
fi-skl-gvtdvm    total:288  pass:266  dwarn:0   dfail:0   fail:0   skip:13  time:442s
fi-skl-x1585l    total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:11  time:487s
fi-snb-2520m     total:288  pass:251  dwarn:0   dfail:0   fail:0   skip:28  time:558s
fi-snb-2600      total:288  pass:248  dwarn:0   dfail:0   fail:2   skip:29  time:413s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_122/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 3+ messages in thread

* ✓ Fi.CI.IGT: success for igt/gem_flink_race: Limit name subtest to 5s
  2017-08-30 10:13 [PATCH igt] igt/gem_flink_race: Limit name subtest to 5s Chris Wilson
  2017-08-30 10:31 ` ✓ Fi.CI.BAT: success for " Patchwork
@ 2017-08-30 11:35 ` Patchwork
  1 sibling, 0 replies; 3+ messages in thread
From: Patchwork @ 2017-08-30 11:35 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: igt/gem_flink_race: Limit name subtest to 5s
URL   : https://patchwork.freedesktop.org/series/29528/
State : success

== Summary ==

Test kms_setmode:
        Subgroup basic:
                pass       -> FAIL       (shard-hsw) fdo#99912
Test kms_flip:
        Subgroup plain-flip-fb-recreate-interruptible:
                fail       -> PASS       (shard-hsw)
Test kms_properties:
        Subgroup plane-properties-legacy:
                skip       -> PASS       (shard-hsw)
Test kms_plane:
        Subgroup plane-position-hole-dpms-pipe-C-planes:
                skip       -> PASS       (shard-hsw)
Test kms_plane_multiple:
        Subgroup legacy-pipe-E-tiling-y:
                incomplete -> SKIP       (shard-hsw)
Test kms_atomic_transition:
        Subgroup plane-all-transition-fencing:
                skip       -> PASS       (shard-hsw)

fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912

shard-hsw        total:2230 pass:1229 dwarn:0   dfail:0   fail:19  skip:982 time:9605s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_122/shards.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-08-30 11:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-30 10:13 [PATCH igt] igt/gem_flink_race: Limit name subtest to 5s Chris Wilson
2017-08-30 10:31 ` ✓ Fi.CI.BAT: success for " Patchwork
2017-08-30 11:35 ` ✓ Fi.CI.IGT: " Patchwork

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.