Skip to content

Commit 1792d6c

Browse files
riandrewsgregkh
authored andcommitted
binder: Use wake up hint for synchronous transactions.
commit 00b40d613352c623aaae88a44e5ded7c912909d7 upstream. 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 <tkjos@google.com> Signed-off-by: Omprakash Dhyade <odhyade@codeaurora.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 596b97e commit 1792d6c

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

drivers/android/binder.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1718,8 +1718,12 @@ static void binder_transaction(struct binder_proc *proc,
17181718
list_add_tail(&t->work.entry, target_list);
17191719
tcomplete->type = BINDER_WORK_TRANSACTION_COMPLETE;
17201720
list_add_tail(&tcomplete->entry, &thread->todo);
1721-
if (target_wait)
1722-
wake_up_interruptible(target_wait);
1721+
if (target_wait) {
1722+
if (reply || !(t->flags & TF_ONE_WAY))
1723+
wake_up_interruptible_sync(target_wait);
1724+
else
1725+
wake_up_interruptible(target_wait);
1726+
}
17231727
return;
17241728

17251729
err_get_unused_fd_failed:

0 commit comments

Comments
 (0)