public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] i915/gem_create: Show number of pages cleared
@ 2019-07-02 18:58 Chris Wilson
  2019-07-02 19:29 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Chris Wilson @ 2019-07-02 18:58 UTC (permalink / raw)
  To: intel-gfx; +Cc: igt-dev

Just a little bit of feedback at the end of an otherwise quiet 20s.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 tests/i915/gem_create.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/tests/i915/gem_create.c b/tests/i915/gem_create.c
index 9008cd8a2..aed7d1cec 100644
--- a/tests/i915/gem_create.c
+++ b/tests/i915/gem_create.c
@@ -187,6 +187,7 @@ struct thread_clear {
 static void *thread_clear(void *data)
 {
 	struct thread_clear *arg = data;
+	unsigned long checked = 0;
 	int i915 = arg->i915;
 
 	igt_until_timeout(arg->timeout) {
@@ -209,11 +210,12 @@ static void *thread_clear(void *data)
 			igt_assert_eq_u64(x, 0);
 		}
 		gem_close(i915, create.handle);
+		checked += npages;
 
 		atomic_fetch_add(&arg->max, npages);
 	}
 
-	return NULL;
+	return (void *)(uintptr_t)checked;
 }
 
 static void always_clear(int i915, int timeout)
@@ -224,12 +226,19 @@ static void always_clear(int i915, int timeout)
 		.max = intel_get_avail_ram_mb() << (20 - 12), /* in pages */
 	};
 	const int ncpus = sysconf(_SC_NPROCESSORS_ONLN);
+	unsigned long checked;
 	pthread_t thread[ncpus];
+	void *result;
 
 	for (int i = 0; i < ncpus; i++)
 		pthread_create(&thread[i], NULL, thread_clear, &arg);
-	for (int i = 0; i < ncpus; i++)
-		pthread_join(thread[i], NULL);
+
+	checked = 0;
+	for (int i = 0; i < ncpus; i++) {
+		pthread_join(thread[i], &result);
+		checked += (uintptr_t)result;
+	}
+	igt_info("Checked %'lu page allocations\n", checked);
 }
 
 static void size_update(int fd)
-- 
2.20.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

end of thread, other threads:[~2019-07-04 21:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-02 18:58 [igt-dev] [PATCH i-g-t] i915/gem_create: Show number of pages cleared Chris Wilson
2019-07-02 19:29 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2019-07-03 18:40 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2019-07-04 21:24 ` [igt-dev] [PATCH i-g-t] " Matthew Auld

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox