Skip to content

Commit

Permalink
binder: update low_latency selection for binder transactions
Browse files Browse the repository at this point in the history
The change limits the low_latency flag selection to binder
transactions of the foreground high priority tasks.

Change-Id: Id191e63ba2ccf5537cb45711c20bc22831129a18
Signed-off-by: Kishore Sri venkata Ganesh Bolisetty <bsrivenk@codeaurora.org>
[clingutla@codeaurora.org: Resolved trivial merge conflicts]
Signed-off-by: Lingutla Chandrasekhar <clingutla@codeaurora.org>
Signed-off-by: engstk <eng.stk@sapo.pt>
  • Loading branch information
Kishore Sri venkata Ganesh Bolisetty authored and engstk committed Nov 9, 2020
1 parent 79224af commit ba24827
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions drivers/android/binder.c
Original file line number Diff line number Diff line change
Expand Up @@ -1028,10 +1028,10 @@ static void binder_wakeup_poll_threads_ilocked(struct binder_proc *proc,
if (thread->looper & BINDER_LOOPER_STATE_POLL &&
binder_available_for_proc_work_ilocked(thread)) {
#ifdef CONFIG_SCHED_WALT
if (sync && thread->task && thread->task->signal &&
(thread->task->signal->oom_score_adj <= 0)) {
if (thread->task && current->signal &&
(current->signal->oom_score_adj == 0) &&
(current->prio < DEFAULT_PRIO))
thread->task->low_latency = true;
}
#endif
if (sync)
wake_up_interruptible_sync(&thread->wait);
Expand Down Expand Up @@ -1093,8 +1093,9 @@ static void binder_wakeup_thread_ilocked(struct binder_proc *proc,

if (thread) {
#ifdef CONFIG_SCHED_WALT
if (sync && thread->task && thread->task->signal &&
(thread->task->signal->oom_score_adj <= 0))
if (thread->task && current->signal &&
(current->signal->oom_score_adj == 0) &&
(current->prio < DEFAULT_PRIO))
thread->task->low_latency = true;
#endif
if (sync)
Expand Down Expand Up @@ -3610,12 +3611,7 @@ static void binder_transaction(struct binder_proc *proc,
binder_pop_transaction_ilocked(target_thread, in_reply_to);
binder_enqueue_thread_work_ilocked(target_thread, &t->work);
binder_inner_proc_unlock(target_proc);
#ifdef CONFIG_SCHED_WALT
if (target_thread->task && target_thread->task->signal &&
(target_thread->task->signal->oom_score_adj <= 0)) {
target_thread->task->low_latency = true;
}
#endif

wake_up_interruptible_sync(&target_thread->wait);
binder_restore_priority(current, in_reply_to->saved_priority);
binder_free_transaction(in_reply_to);
Expand Down

0 comments on commit ba24827

Please sign in to comment.