提交 a14917ee 编写于 作者: C Chris Wilson 提交者: Daniel Vetter

drm/i915: Release the mmap offset when purging a buffer

If we discard a buffer due to memory pressure, also release its alloted
mmap address space. As it may be sometime before userspace wakes up
and notices that it has buffers to purge from its cache, we may waste
valuable address space on unusable objects for a period of time.
Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=47738Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
上级 121d527a
......@@ -1546,6 +1546,9 @@ i915_gem_object_truncate(struct drm_i915_gem_object *obj)
inode = obj->base.filp->f_path.dentry->d_inode;
shmem_truncate_range(inode, 0, (loff_t)-1);
if (obj->base.map_list.map)
drm_gem_free_mmap_offset(&obj->base);
obj->madv = __I915_MADV_PURGED;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册