Skip to content

Commit

Permalink
binder: Use wake up hint for synchronous transactions.
Browse files Browse the repository at this point in the history
Use wake_up_interruptible_sync() to hint to the scheduler binder
transactions are synchronous wakeups. Disable preemption while waking
to avoid ping-ponging on the binder lock.

Signed-off-by: Todd Kjos <[email protected]>
Signed-off-by: Omprakash Dhyade <[email protected]>
Cc: stable <[email protected]> # 4.4+
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
riandrews authored and gregkh committed Jul 17, 2017
1 parent c4ea41b commit 00b40d6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions drivers/android/binder.c
Original file line number Diff line number Diff line change
Expand Up @@ -2200,8 +2200,12 @@ static void binder_transaction(struct binder_proc *proc,
list_add_tail(&t->work.entry, target_list);
tcomplete->type = BINDER_WORK_TRANSACTION_COMPLETE;
list_add_tail(&tcomplete->entry, &thread->todo);
if (target_wait)
wake_up_interruptible(target_wait);
if (target_wait) {
if (reply || !(t->flags & TF_ONE_WAY))
wake_up_interruptible_sync(target_wait);
else
wake_up_interruptible(target_wait);
}
return;

err_translate_failed:
Expand Down

0 comments on commit 00b40d6

Please sign in to comment.