drm/i915/selftests: Disable shrinker across mmap-exhaustion
authorChris Wilson <[email protected]>
Thu, 11 Oct 2018 10:37:48 +0000 (11:37 +0100)
committerChris Wilson <[email protected]>
Thu, 11 Oct 2018 15:04:09 +0000 (16:04 +0100)
For mmap-exhaustion, we deliberately put the system under a large amount
of pressure to ensure that we are able to reap mmap-offsets from dead
objects. If background activity does that reaping for us, that defeats
the purpose of the test and in some cases will fail our sanity checks
(because of the fake activity we use to prevent the idle worker).

Fixes: 932cac10c8fb ("drm/i915/selftests: Prevent background reaping of acti
ve objects")
Signed-off-by: Chris Wilson <[email protected]>
Cc: Mika Kuoppala <[email protected]>
Cc: Matthew Auld <[email protected]>
Reviewed-by: Mika Kuoppala <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
drivers/gpu/drm/i915/selftests/i915_gem_object.c

index 6d3516d5bff9e5154d83da66033950e132acc7b9..c3999dd2021e4b76816a50ab0df6396205df5e2b 100644 (file)
@@ -501,6 +501,8 @@ static bool assert_mmap_offset(struct drm_i915_private *i915,
 
 static void disable_retire_worker(struct drm_i915_private *i915)
 {
+       i915_gem_shrinker_unregister(i915);
+
        mutex_lock(&i915->drm.struct_mutex);
        if (!i915->gt.active_requests++) {
                intel_runtime_pm_get(i915);
@@ -613,6 +615,7 @@ out_park:
        else
                queue_delayed_work(i915->wq, &i915->gt.idle_work, 0);
        mutex_unlock(&i915->drm.struct_mutex);
+       i915_gem_shrinker_register(i915);
        return err;
 err_obj:
        i915_gem_object_put(obj);