diff options
| author | John Stultz <john.stultz@linaro.org> | 2013-12-17 17:04:29 -0800 |
|---|---|---|
| committer | Colin Cross <ccross@android.com> | 2013-12-19 19:25:39 -0800 |
| commit | c6448537fe9e8b684b214e89c6c68c3b209f549e (patch) | |
| tree | c1703427892a1871b9184470dfcc98f262790277 /lib/mpi/mpiutil.c | |
| parent | 60e11dfc002962181fe4f0db54b33c65fee02c52 (diff) | |
| download | olio-linux-3.10-c6448537fe9e8b684b214e89c6c68c3b209f549e.tar.xz olio-linux-3.10-c6448537fe9e8b684b214e89c6c68c3b209f549e.zip | |
staging: ion: Avoid using rt_mutexes directly
RT_MUTEXES can be configured out of the kernel, causing compile
problems with ION.
To quote Colin:
"rt_mutexes were added with the deferred freeing feature. Heaps need
to return zeroed memory to userspace, but zeroing the memory on every
allocation was causing performance issues. We added a SCHED_IDLE
thread to zero memory in the background after freeing, but locking the
heap from the SCHED_IDLE thread might block a high priority allocation
thread for a long time.
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."
Thus this patch converts the rt_mutex usage to a spinlock and
renames the lock free_lock to be more clear as to its use.
I also had to change a bit of logic in ion_heap_freelist_drain()
to safely avoid list corruption.
Acked-by: Colin Cross <ccross@android.com>
Cc: Android Kernel Team <kernel-team@android.com>
Reported-by: Jim Davis <jim.epost@gmail.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'lib/mpi/mpiutil.c')
0 files changed, 0 insertions, 0 deletions