diff --git a/drivers/android/binder.c b/drivers/android/binder.c index aa5ffe9bf509..32f6a5fef13e 100644 --- a/drivers/android/binder.c +++ b/drivers/android/binder.c @@ -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",