Re: [PATCH] drm/i915: Drop mutex after successful kref_put_mutex()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Dec 19, 2016 at 01:38:13PM +0200, Joonas Lahtinen wrote:
> On ma, 2016-12-19 at 10:13 +0000, Chris Wilson wrote:
> > The kref_put_mutex() returns with the mutex held after freeing the
> > object - so we must remember to drop it...
> > 
> > Fixes: 69df05e11ab8 ("drm/i915: Simplify releasing context reference")
> > Signed-off-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
> > Cc: Tvrtko Ursulin <tvrtko.ursulin@xxxxxxxxx>
> 
> Reviewed-by: Joonas Lahtinen <joonas.lahtinen@xxxxxxxxxxxxxxx>

Ta, wish I remembered the sting in its tail.

Does a unittest such as:

struct i915_gem_context *ctx;

mutex_lock(&struct_mutex);
ctx = i915_gem_context_create();
mutex_unlock(&struct_mutex);

i915_gem_context_put_unlocked(ctx);
might_lock(&strct_mutex);

Make sense? Feels a little too much like bolting the stable door and not
likely to detect a future bug.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux