diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 949475d4e1d6..1bbf60546b0b 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -4091,13 +4091,24 @@ place_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int initial) vruntime -= thresh; #ifdef CONFIG_SCHED_WALT if (entity_is_task(se)) { + if (task_rtg_high_prio(task_of(se)) || + walt_procfs_low_latency_task(task_of(se))) { + vruntime -= thresh; + se->vruntime = vruntime; + } + if (walt_binder_low_latency_task(task_of(se))) { + vruntime -= sysctl_sched_latency; + se->vruntime = vruntime; + } + if (per_task_boost(task_of(se)) == TASK_BOOST_STRICT_MAX) { + vruntime -= thresh; + vruntime -= sysctl_sched_latency; + se->vruntime = vruntime; + } if ((per_task_boost(task_of(se)) == TASK_BOOST_STRICT_MAX) || walt_low_latency_task(task_of(se)) || task_rtg_high_prio(task_of(se))) { - vruntime -= sysctl_sched_latency; - vruntime -= thresh; - se->vruntime = vruntime; return; } } diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index 81366fc19677..a639fa91f96c 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -3011,6 +3011,18 @@ static inline bool walt_low_latency_task(struct task_struct *p) (task_util(p) < sysctl_walt_low_latency_task_threshold); } +static inline bool walt_binder_low_latency_task(struct task_struct *p) +{ + return (p->wts.low_latency & WALT_LOW_LATENCY_BINDER) && + (task_util(p) < sysctl_walt_low_latency_task_threshold); +} + +static inline bool walt_procfs_low_latency_task(struct task_struct *p) +{ + return (p->wts.low_latency & WALT_LOW_LATENCY_PROCFS) && + (task_util(p) < sysctl_walt_low_latency_task_threshold); +} + /* Is frequency of two cpus synchronized with each other? */ static inline int same_freq_domain(int src_cpu, int dst_cpu) {