lkml.org 
[lkml]   [2013]   [Dec]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [RFC][PATCH 3/3] staging: ion: Avoid using rt_mutexes directly.
From
On Mon, Dec 16, 2013 at 5:22 PM, John Stultz <john.stultz@linaro.org> wrote:
> On 12/16/2013 04:17 PM, Colin Cross wrote:
>> The lock is only used to protect the heap's free_list and
>> free_list_size members, and is not held for any long or sleeping
>> operations. Converting to a spinlock should prevent priority
>> inversion without using the rt_mutex. I'd also rename it to free_lock
>> to so it doesn't get used as a general heap lock.
>
> Hrm.. So at least a trivial conversion to use spinlocks doesn't quite
> work out, as we call ion_buffer_destroy() in ion_heap_freelist_drain()
> while holding the lock, and that calls all sorts of not safe stuff.
>
> I'll spend some more time looking at it later tonight, but let me know
> if you have an approach for this case in mind.

Drop and re-grab the lock around ion_buffer_destroy, it's not
necessary during the destroy, and the list iteration is already using
list_for_each_entry_safe, so it doesn't matter if another caller
modifies the list during the destroy.


\
 
 \ /
  Last update: 2013-12-17 03:01    [W:0.052 / U:0.180 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site