|
@@ -531,6 +531,14 @@ static void vm_free_page(struct i915_address_space *vm, struct page *page)
|
|
|
static void i915_address_space_init(struct i915_address_space *vm,
|
|
|
struct drm_i915_private *dev_priv)
|
|
|
{
|
|
|
+ /*
|
|
|
+ * The vm->mutex must be reclaim safe (for use in the shrinker).
|
|
|
+ * Do a dummy acquire now under fs_reclaim so that any allocation
|
|
|
+ * attempt holding the lock is immediately reported by lockdep.
|
|
|
+ */
|
|
|
+ mutex_init(&vm->mutex);
|
|
|
+ i915_gem_shrinker_taints_mutex(&vm->mutex);
|
|
|
+
|
|
|
GEM_BUG_ON(!vm->total);
|
|
|
drm_mm_init(&vm->mm, 0, vm->total);
|
|
|
vm->mm.head_node.color = I915_COLOR_UNEVICTABLE;
|
|
@@ -551,6 +559,8 @@ static void i915_address_space_fini(struct i915_address_space *vm)
|
|
|
spin_unlock(&vm->free_pages.lock);
|
|
|
|
|
|
drm_mm_takedown(&vm->mm);
|
|
|
+
|
|
|
+ mutex_destroy(&vm->mutex);
|
|
|
}
|
|
|
|
|
|
static int __setup_page_dma(struct i915_address_space *vm,
|