Commit e6db7f4d authored by Chris Wilson's avatar Chris Wilson
Browse files

drm/i915: Break long iterations for get/put shmemfs pages

As we may have to iterate a few thousand elements to acquire and release
the shmemfs backing storage for a GPU object, we need to break up the
long loop with cond_resched() to retain a modicum of low latency for
other processes.

Testcase: igt/benchmarks/gem_syslatency
Signed-off-by: default avatarChris Wilson <>
Cc: Kuo-Hsin Yang <>
Cc: Matthew Auld <>
Cc: Joonas Lahtinen <>
Reviewed-by: default avatarJoonas Lahtinen <>
parent bfe60a02
......@@ -2404,6 +2404,7 @@ i915_gem_object_put_pages_gtt(struct drm_i915_gem_object *obj,
obj->mm.dirty = false;
......@@ -2574,6 +2575,7 @@ static int i915_gem_object_get_pages_gtt(struct drm_i915_gem_object *obj)
gfp_t gfp = noreclaim;
do {
page = shmem_read_mapping_page_gfp(mapping, i, gfp);
if (likely(!IS_ERR(page)))
......@@ -2584,7 +2586,6 @@ static int i915_gem_object_get_pages_gtt(struct drm_i915_gem_object *obj)
i915_gem_shrink(dev_priv, 2 * page_count, NULL, *s++);
* We've tried hard to allocate the memory by reaping
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment