From 2f859537b59907a3e0a082c1cb6f6dfb8e99b616 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Fri, 22 Apr 2016 16:37:35 +0100 Subject: [PATCH] igt/gem_close_race: Import the scratch Rather than create a new scratch buffer every pass, import the original as this provides stress upon less commonly trod paths (i.e. handling objects with many vma) as well as many objects in general. Signed-off-by: Chris Wilson --- tests/gem_close_race.c | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/tests/gem_close_race.c b/tests/gem_close_race.c index e6537c3b..9cfdbf3f 100644 --- a/tests/gem_close_race.c +++ b/tests/gem_close_race.c @@ -169,8 +169,10 @@ static void threads(int timeout) { struct sigevent sev; struct sigaction act; + struct drm_gem_open name; struct itimerspec its; timer_t timer; + int fd; memset(&act, 0, sizeof(act)); act.sa_handler = crashme_now; @@ -182,8 +184,9 @@ static void threads(int timeout) sev.sigev_signo = SIGRTMIN; igt_assert(timer_create(CLOCK_MONOTONIC, &sev, &timer) == 0); + fd = open(device, O_RDWR); + name.name = gem_flink(fd, gem_create(fd, OBJECT_SIZE)); - int count = 0; igt_timeout(timeout) { crashme.fd = open(device, O_RDWR); @@ -192,24 +195,16 @@ static void threads(int timeout) igt_assert(timer_settime(timer, 0, &its, NULL) == 0); do { - struct drm_i915_gem_create create; - - count++; - memset(&create, 0, sizeof(create)); - create.handle = 0; - create.size = 4096; - drmIoctl(crashme.fd, DRM_IOCTL_I915_GEM_CREATE, &create); - - selfcopy(crashme.fd, create.handle, 100); - - if (drmIoctl(crashme.fd, DRM_IOCTL_GEM_CLOSE, &create.handle)) + if (drmIoctl(crashme.fd, DRM_IOCTL_GEM_OPEN, &name)) break; - } while (1); + selfcopy(crashme.fd, name.handle, 100); + drmIoctl(crashme.fd, DRM_IOCTL_GEM_CLOSE, &name.handle); + } while (1); } - printf("count = %d\n", count); timer_delete(timer); + close(fd); } igt_main @@ -246,7 +241,7 @@ igt_main } igt_subtest("gem-close-race") - threads(120); + threads(150); igt_stop_hang_detector(); }