From: Johnlay Park Date: Wed, 28 Feb 2018 03:54:30 +0000 (+0900) Subject: [COMMON] sched/rt: Use pelt RT b/w in scale_rt_capacity X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b8e8f000ecd7deadb1c4f35577968213027d5701;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [COMMON] sched/rt: Use pelt RT b/w in scale_rt_capacity Remove rt tasks from rt_avg metric and directly use the average b/w of rt scheduler in scale_rt_capacity Change-Id: Ibcb772c15251aae8924ef1580bf81c9f05a26eb8 Signed-off-by: Johnlay Park --- diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index e2a849be4c34..9a86694f6d88 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -8729,23 +8729,16 @@ static inline int get_sd_load_idx(struct sched_domain *sd, static unsigned long scale_rt_capacity(int cpu) { struct rq *rq = cpu_rq(cpu); - u64 total, used, age_stamp, avg; - s64 delta; + s64 used; /* - * Since we're reading these variables without serialization make sure - * we read them once before doing sanity checks on them. + * Instread of rt_avg in rq, use the sched_rt_avg for more precise caculation */ - age_stamp = READ_ONCE(rq->age_stamp); - avg = READ_ONCE(rq->rt_avg); - delta = __rq_clock_broken(rq) - age_stamp; - - if (unlikely(delta < 0)) - delta = 0; - - total = sched_avg_period() + delta; + used = rq->rt.avg.util_avg; - used = div_u64(avg, total); + /* + * Need to consider bandwidth of deadline tasks + */ if (likely(used < SCHED_CAPACITY_SCALE)) return SCHED_CAPACITY_SCALE - used;