binder: update latency_sensitive flag for binder transactions

To minimize wake up latency for binder transactions,
set low_latency flag.

Change-Id: If103199fc96e35d90b0eaaf32da38ae135976658
Signed-off-by: Kishore Sri venkata Ganesh Bolisetty <bsrivenk@codeaurora.org>
This commit is contained in:
Kishore Sri venkata Ganesh Bolisetty 2020-06-29 23:44:39 -07:00
commit f9478fd636

View file

@ -979,6 +979,11 @@ static void binder_wakeup_poll_threads_ilocked(struct binder_proc *proc,
thread = rb_entry(n, struct binder_thread, rb_node);
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))
thread->task->wts.low_latency = true;
#endif
if (sync)
wake_up_interruptible_sync(&thread->wait);
else
@ -1038,6 +1043,11 @@ static void binder_wakeup_thread_ilocked(struct binder_proc *proc,
assert_spin_locked(&proc->inner_lock);
if (thread) {
#ifdef CONFIG_SCHED_WALT
if (sync && thread->task && thread->task->signal &&
(thread->task->signal->oom_score_adj <= 0))
thread->task->wts.low_latency = true;
#endif
if (sync)
wake_up_interruptible_sync(&thread->wait);
else
@ -3598,6 +3608,12 @@ 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->wts.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);
@ -4690,6 +4706,10 @@ retry:
ptr += trsize;
trace_binder_transaction_received(t);
#ifdef CONFIG_SCHED_WALT
if (current->wts.low_latency)
current->wts.low_latency = false;
#endif
binder_stat_br(proc, thread, cmd);
binder_debug(BINDER_DEBUG_TRANSACTION,
"%d:%d %s %d %d:%d, cmd %d size %zd-%zd ptr %016llx-%016llx\n",