Skip to content

Commit

Permalink
drm/i915: Break up long runs of freeing objects
Browse files Browse the repository at this point in the history
Before freeing the next batch of objects from the worker, check if the
worker's timeslice has expired and if so, defer the next batch to the
next invocation of the worker.

Suggested-by: Andrea Arcangeli <aarcange@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170407102552.5781-3-chris@chris-wilson.co.uk
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
  • Loading branch information
Chris Wilson committed Apr 7, 2017
1 parent e92075f commit 5ad08be
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/gpu/drm/i915/i915_gem.c
Original file line number Diff line number Diff line change
Expand Up @@ -4349,8 +4349,11 @@ static void __i915_gem_free_work(struct work_struct *work)
* unbound now.
*/

while ((freed = llist_del_all(&i915->mm.free_list)))
while ((freed = llist_del_all(&i915->mm.free_list))) {
__i915_gem_free_objects(i915, freed);
if (need_resched())
break;
}
}

static void __i915_gem_free_object_rcu(struct rcu_head *head)
Expand Down

0 comments on commit 5ad08be

Please sign in to comment.