From: Riley Andrews Date: Sat, 27 Sep 2014 00:36:36 +0000 (-0700) Subject: staging: binder: Change binder mutex to rtmutex. X-Git-Tag: firefly_0821_release~4090^2~150 X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=5d03bd0fdd66d3472386864cf32b4b82dda8d1a5;p=firefly-linux-kernel-4.4.55.git staging: binder: Change binder mutex to rtmutex. Surfaceflinger uses binder heavily to receive/send frames from applications while compositing the screen. Change the binder mutex to an rt mutex to minimize instances where high priority surfaceflinger binder work is blocked by lower priority binder ipc. Signed-off-by: Riley Andrews Change-Id: I086a715267648448f0c5f62b037a3093d1079a79 --- diff --git a/drivers/staging/android/binder.c b/drivers/staging/android/binder.c index d4e529001934..9c821f398cad 100644 --- a/drivers/staging/android/binder.c +++ b/drivers/staging/android/binder.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -42,7 +43,7 @@ #include "binder.h" #include "binder_trace.h" -static DEFINE_MUTEX(binder_main_lock); +static DEFINE_RT_MUTEX(binder_main_lock); static DEFINE_MUTEX(binder_deferred_lock); static DEFINE_MUTEX(binder_mmap_lock); @@ -420,14 +421,14 @@ static long task_close_fd(struct binder_proc *proc, unsigned int fd) static inline void binder_lock(const char *tag) { trace_binder_lock(tag); - mutex_lock(&binder_main_lock); + rt_mutex_lock(&binder_main_lock); trace_binder_locked(tag); } static inline void binder_unlock(const char *tag) { trace_binder_unlock(tag); - mutex_unlock(&binder_main_lock); + rt_mutex_unlock(&binder_main_lock); } static void binder_set_nice(long nice)