[PATCH v2 5/5] drm/i915: Revoke any shmemfs mappings on shrinking

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When trying to shrink our buffers, also revoke any existing mappings
(forcing them to be faulted again on reuse) to improve the likelihood of
us being able to pageout the buffer.

Signed-off-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
---
 drivers/gpu/drm/i915/i915_gem.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 7d400d882283..a9388a5eef31 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -2212,8 +2212,9 @@ void __i915_gem_object_invalidate(struct drm_i915_gem_object *obj)
 	if (obj->base.filp == NULL)
 		return;
 
-	mapping = obj->base.filp->f_mapping,
+	mapping = obj->base.filp->f_mapping;
 	invalidate_mapping_pages(mapping, 0, (loff_t)-1);
+	unmap_mapping_range(mapping, 0, (loff_t)-1, 0);
 }
 
 static void
-- 
2.11.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux