diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2017-03-23 17:09:26 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2017-03-23 17:09:48 +0000 |
commit | 137360f75a42042198cf00d35a54cc68660d8c90 (patch) | |
tree | 71bc2c45808158d6acb3dacff49ec10c6a70a01f /lib/drmtest.c | |
parent | f22e19b38a1593b207b6044cf8fb953c5cddc2b7 (diff) |
lib: system() is bad, use libkmod instead
For an as of yet unknown reason, calling system("modprobe") from inside
igt/gem_wait causes kasan to spend 1-5 minutes copying the process
pagetables. This evaporates if we replace the fork-happy call to system
with a call to load the module using libkmod. So be it.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'lib/drmtest.c')
-rw-r--r-- | lib/drmtest.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/drmtest.c b/lib/drmtest.c index 35f71c0d..fab705ad 100644 --- a/lib/drmtest.c +++ b/lib/drmtest.c @@ -51,8 +51,9 @@ #include "i915_drm.h" #include "intel_chipset.h" #include "intel_io.h" -#include "igt_gt.h" #include "igt_debugfs.h" +#include "igt_gt.h" +#include "igt_kmod.h" #include "version.h" #include "config.h" #include "intel_reg.h" @@ -228,9 +229,7 @@ int drm_get_card(void) static int modprobe(const char *driver) { - char buf[128]; - snprintf(buf, sizeof(buf), "/sbin/modprobe -s %s", driver); - return system(buf); + return igt_kmod_load(driver, ""); } /** |