[PATCH 03/10] drm/i915: Use our singlethreaded wq for freeing objects
Chris Wilson
chris at chris-wilson.co.uk
Sat Dec 30 22:00:25 UTC 2017
As freeing the objects require serialisation on struct_mutex, we should
prefer to use our singlethreaded driver wq that is dedicated to work
requiring struct_mutex (hence serialised).The benefit should be less
clutter on the system wq, allowing it to make progress even when the
driver/struct_mutex is heavily contended.
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
---
drivers/gpu/drm/i915/i915_drv.c | 2 +-
drivers/gpu/drm/i915/i915_gem.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 6c8da9d20c33..069c308c0383 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -805,7 +805,7 @@ static int i915_workqueues_init(struct drm_i915_private *dev_priv)
* so there is no point in running more than one instance of the
* workqueue at any time. Use an ordered one.
*/
- dev_priv->wq = alloc_ordered_workqueue("i915", 0);
+ dev_priv->wq = alloc_ordered_workqueue("i915", WQ_MEM_RECLAIM);
if (dev_priv->wq == NULL)
goto out_err;
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index ba9f67c256f4..4808011264ae 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -4732,7 +4732,7 @@ static void __i915_gem_free_object_rcu(struct rcu_head *head)
* detour through a worker.
*/
if (llist_add(&obj->freed, &i915->mm.free_list))
- schedule_work(&i915->mm.free_work);
+ queue_work(i915->wq, &i915->mm.free_work);
}
void i915_gem_free_object(struct drm_gem_object *gem_obj)
--
2.15.1
More information about the Intel-gfx-trybot
mailing list