aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2013-05-06 19:50:15 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-05-12 08:16:22 -0400
commite2610b268bb74d24866a9578e78d8c3de90ed596 (patch)
tree0daf0d50ba6c52166d79aa83dbd50bd6479f15bf
parentdd5ec0f4e72bed3d0e589e21fdf46eedafc106b7 (diff)
binder: use freezable blocking calls
Avoid waking up every thread sleeping in a binder call during suspend and resume by calling a freezable blocking call. Previous patches modified the freezer to avoid sending wakeups to threads that are blocked in freezable blocking calls. This call was selected to be converted to a freezable call because it doesn't hold any locks or release any resources when interrupted that might be needed by another freezing task or a kernel driver during suspend, and is a common site where idle userspace tasks are blocked. Acked-by: Tejun Heo <tj@kernel.org> Signed-off-by: Colin Cross <ccross@android.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r--drivers/staging/android/binder.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/staging/android/binder.c b/drivers/staging/android/binder.c
index 1567ac296b39..1ffc2ebdf612 100644
--- a/drivers/staging/android/binder.c
+++ b/drivers/staging/android/binder.c
@@ -20,6 +20,7 @@
20#include <asm/cacheflush.h> 20#include <asm/cacheflush.h>
21#include <linux/fdtable.h> 21#include <linux/fdtable.h>
22#include <linux/file.h> 22#include <linux/file.h>
23#include <linux/freezer.h>
23#include <linux/fs.h> 24#include <linux/fs.h>
24#include <linux/list.h> 25#include <linux/list.h>
25#include <linux/miscdevice.h> 26#include <linux/miscdevice.h>
@@ -2140,13 +2141,13 @@ retry:
2140 if (!binder_has_proc_work(proc, thread)) 2141 if (!binder_has_proc_work(proc, thread))
2141 ret = -EAGAIN; 2142 ret = -EAGAIN;
2142 } else 2143 } else
2143 ret = wait_event_interruptible_exclusive(proc->wait, binder_has_proc_work(proc, thread)); 2144 ret = wait_event_freezable_exclusive(proc->wait, binder_has_proc_work(proc, thread));
2144 } else { 2145 } else {
2145 if (non_block) { 2146 if (non_block) {
2146 if (!binder_has_thread_work(thread)) 2147 if (!binder_has_thread_work(thread))
2147 ret = -EAGAIN; 2148 ret = -EAGAIN;
2148 } else 2149 } else
2149 ret = wait_event_interruptible(thread->wait, binder_has_thread_work(thread)); 2150 ret = wait_event_freezable(thread->wait, binder_has_thread_work(thread));
2150 } 2151 }
2151 2152
2152 binder_lock(__func__); 2153 binder_lock(__func__);