Skip to content

Commit

Permalink
drm/i915: Wait for the struct_mutex on idling
Browse files Browse the repository at this point in the history
When the system is idling, contention for struct_mutex should be low and
so we will be more efficient to wait for a contended mutex than
reschedule.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190430094405.6127-1-chris@chris-wilson.co.uk
  • Loading branch information
Chris Wilson committed Apr 30, 2019
1 parent d5f9db2 commit 8a9b36e
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions drivers/gpu/drm/i915/i915_gem_pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,7 @@ static void idle_work_handler(struct work_struct *work)
struct drm_i915_private *i915 =
container_of(work, typeof(*i915), gem.idle_work.work);

if (!mutex_trylock(&i915->drm.struct_mutex)) {
/* Currently busy, come back later */
mod_delayed_work(i915->wq,
&i915->gem.idle_work,
msecs_to_jiffies(50));
return;
}
mutex_lock(&i915->drm.struct_mutex);

intel_wakeref_lock(&i915->gt.wakeref);
if (!intel_wakeref_active(&i915->gt.wakeref))
Expand Down

0 comments on commit 8a9b36e

Please sign in to comment.