diff options
author | Vinayak Menon <vinmenon@codeaurora.org> | 2017-06-19 12:19:16 +0530 |
---|---|---|
committer | Vinayak Menon <vinmenon@codeaurora.org> | 2017-06-19 15:21:41 +0530 |
commit | ec4bf25ae034d6e391a5b862b2bd8406acf0441a (patch) | |
tree | ddf9c5278d682da956adfdb4d252033053baea31 /drivers/android/binder.c | |
parent | 1ccabf65ac2fe97fbd2f2ca3a06905f52c16e50c (diff) |
android: binder: enable preemption for vfree
New changes to vfree makes it a sleepable function
which makes it an offense to call vfree from the
binder_deferred_func (via binder_deferred_release).
binder_deferred_func disables preemption for reducing
lock latencies, so to avoid the problem enable preemption
for the duration of vfree execution. vfree_atomic can't be
used as binder unmaps the buffer before doing free, and
vfree_atomic dereferences the to-be-freed address.
Change-Id: I093b37a6d049c7cbb599aeb05012b189b45b587b
Signed-off-by: Vinayak Menon <vinmenon@codeaurora.org>
Diffstat (limited to 'drivers/android/binder.c')
-rw-r--r-- | drivers/android/binder.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/android/binder.c b/drivers/android/binder.c index d1490be45c67..0c3cf182e351 100644 --- a/drivers/android/binder.c +++ b/drivers/android/binder.c @@ -3778,7 +3778,9 @@ static void binder_deferred_release(struct binder_proc *proc) page_count++; } kfree(proc->pages); + preempt_enable_no_resched(); vfree(proc->buffer); + preempt_disable(); } put_task_struct(proc->tsk); |