From b6e5c7c0f52ce103516f815873e9bbc3f913be25 Mon Sep 17 00:00:00 2001 From: Maria Yu Date: Thu, 5 Sep 2019 10:32:39 +0800 Subject: [PATCH] sched/fair: bonus vruntime for task boost 3 When task boost with special value 3 also have vruntime bonus to run faster. Change-Id: I7da2dd985a961671b27036a0d5b13cb79480c933 Signed-off-by: Maria Yu [satyap@codeaurora.org: fix compilation issues with User Mode Linux] Signed-off-by: Satya Durga Srinivasu Prabhala --- kernel/sched/fair.c | 3 +++ kernel/sched/sched.h | 22 +++++++++++----------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 14789ddcf72b..81a407729481 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -4016,6 +4016,9 @@ place_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int initial) thresh >>= 1; vruntime -= thresh; + if (entity_is_task(se) && per_task_boost(task_of(se)) == + TASK_BOOST_STRICT_MAX) + vruntime -= sysctl_sched_latency; } /* ensure we never gain time by being placed backwards. */ diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index 03927ee4cbd6..5409cbee29bc 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -2192,17 +2192,6 @@ unsigned long arch_scale_max_freq_capacity(struct sched_domain *sd, int cpu) unsigned long capacity_curr_of(int cpu); -#ifdef CONFIG_SMP -static inline unsigned long capacity_of(int cpu) -{ - return cpu_rq(cpu)->cpu_capacity; -} - -static inline unsigned long capacity_orig_of(int cpu) -{ - return cpu_rq(cpu)->cpu_capacity_orig; -} - #ifdef CONFIG_SCHED_WALT static inline int per_task_boost(struct task_struct *p) { @@ -2222,6 +2211,17 @@ static inline int per_task_boost(struct task_struct *p) } #endif +#ifdef CONFIG_SMP +static inline unsigned long capacity_of(int cpu) +{ + return cpu_rq(cpu)->cpu_capacity; +} + +static inline unsigned long capacity_orig_of(int cpu) +{ + return cpu_rq(cpu)->cpu_capacity_orig; +} + static inline unsigned long task_util(struct task_struct *p) { #ifdef CONFIG_SCHED_WALT