diff --git a/kernel/sched/tune.c b/kernel/sched/tune.c index 017d09390689..eb1e70a6a667 100644 --- a/kernel/sched/tune.c +++ b/kernel/sched/tune.c @@ -474,32 +474,9 @@ int schedtune_cpu_boost(int cpu) return bg->boost_max; } -static inline int schedtune_adj_ta(struct task_struct *p) -{ - struct schedtune *st; - char name_buf[NAME_MAX + 1]; - int adj = p->signal->oom_score_adj; - - /* We only care about adj == 0 */ - if (adj != 0) - return 0; - - /* Don't touch kthreads */ - if (p->flags & PF_KTHREAD) - return 0; - - st = task_schedtune(p); - cgroup_name(st->css.cgroup, name_buf, sizeof(name_buf)); - if (!strncmp(name_buf, "top-app", strlen("top-app"))) { - pr_debug("top app is %s with adj %i\n", p->comm, adj); - return 1; - } - - return 0; -} - int schedtune_task_boost(struct task_struct *p) { + struct schedtune *st; int task_boost; if (unlikely(!schedtune_initialized)) @@ -507,7 +484,8 @@ int schedtune_task_boost(struct task_struct *p) /* Get task boost value */ rcu_read_lock(); - task_boost = schedtune_adj_ta(p); + st = task_schedtune(p); + task_boost = st->boost; rcu_read_unlock(); return task_boost; @@ -518,13 +496,15 @@ int schedtune_task_boost(struct task_struct *p) */ int schedtune_task_boost_rcu_locked(struct task_struct *p) { + struct schedtune *st; int task_boost; if (unlikely(!schedtune_initialized)) return 0; /* Get task boost value */ - task_boost = schedtune_adj_ta(p); + st = task_schedtune(p); + task_boost = st->boost; return task_boost; }