From 22b44e45c745fcfa721e79186dff3a386ae63cfb Mon Sep 17 00:00:00 2001 From: Pavankumar Kondeti Date: Tue, 2 Feb 2021 12:13:39 +0530 Subject: [PATCH] sched/walt: Remove sched_load_boost related code The sched_load_boost feature will be introduced in a different form in the subsequent patch. Change-Id: Ib528ccd0fcb78f85685399264cb58212752ca26b Signed-off-by: Pavankumar Kondeti --- kernel/sched/walt/sysctl.c | 51 ------------------------------------ kernel/sched/walt/walt.c | 25 ++++-------------- kernel/sched/walt/walt.h | 13 --------- kernel/sched/walt/walt_cfs.c | 1 - 4 files changed, 5 insertions(+), 85 deletions(-) diff --git a/kernel/sched/walt/sysctl.c b/kernel/sched/walt/sysctl.c index 83ad94ca4536..d55ea70184fc 100644 --- a/kernel/sched/walt/sysctl.c +++ b/kernel/sched/walt/sysctl.c @@ -40,7 +40,6 @@ unsigned int sysctl_input_boost_ms; unsigned int sysctl_input_boost_freq[8]; unsigned int sysctl_sched_boost_on_input; unsigned int sysctl_sched_init_stage; -unsigned int sysctl_sched_load_boost[WALT_NR_CPUS]; /* sysctl nodes accesed by other files */ unsigned int __read_mostly sysctl_sched_coloc_downmigrate_ns; @@ -352,49 +351,6 @@ static int sched_task_handler(struct ctl_table *table, int write, return ret; } -static int sched_load_boost_handler(struct ctl_table *table, int write, - void __user *buffer, size_t *lenp, - loff_t *ppos) -{ - int ret, i; - unsigned int *data = (unsigned int *)table->data; - int val[WALT_NR_CPUS]; - - struct ctl_table tmp = { - .data = &val, - .maxlen = sizeof(val), - .mode = table->mode, - }; - static DEFINE_MUTEX(mutex); - - mutex_lock(&mutex); - - if (!write) { - ret = proc_dointvec(table, write, buffer, lenp, ppos); - goto unlock_mutex; - } - - ret = proc_dointvec(&tmp, write, buffer, lenp, ppos); - if (ret) - goto unlock_mutex; - - for (i = 0; i < WALT_NR_CPUS; i++) { - if (val[i] < -100 || val[i] > 1000) { - ret = -EINVAL; - goto unlock_mutex; - } - } - - /* all things checkout update the value */ - for (i = 0; i < WALT_NR_CPUS; i++) - data[i] = val[i]; - -unlock_mutex: - mutex_unlock(&mutex); - - return ret; -} - #ifdef CONFIG_PROC_SYSCTL static void sched_update_updown_migrate_values(bool up) { @@ -849,13 +805,6 @@ struct ctl_table walt_table[] = { .extra1 = SYSCTL_ONE, .extra2 = SYSCTL_INT_MAX, }, - { - .procname = "sched_load_boost", - .data = &sysctl_sched_load_boost, - .maxlen = sizeof(unsigned int) * 8, - .mode = 0644, - .proc_handler = sched_load_boost_handler, - }, { } }; diff --git a/kernel/sched/walt/walt.c b/kernel/sched/walt/walt.c index baa9b8427c0a..e6a9f6ddea37 100644 --- a/kernel/sched/walt/walt.c +++ b/kernel/sched/walt/walt.c @@ -172,12 +172,6 @@ __read_mostly unsigned int new_sched_ravg_window = DEFAULT_SCHED_RAVG_WINDOW; static DEFINE_SPINLOCK(sched_ravg_window_lock); u64 sched_ravg_window_change_time; -/* - * A after-boot constant divisor for cpu_util_freq_walt() to apply the load - * boost. - */ -static __read_mostly unsigned int walt_cpu_util_freq_divisor; - unsigned int __read_mostly sched_init_task_load_windows_scaled; unsigned int __read_mostly sysctl_sched_init_task_load_pct = 15; @@ -616,30 +610,23 @@ static bool rtgb_active; static inline unsigned long __cpu_util_freq_walt(int cpu, struct walt_cpu_load *walt_load) { - u64 util, util_unboosted; + u64 util; struct rq *rq = cpu_rq(cpu); unsigned long capacity = capacity_orig_of(cpu); - int boost; struct walt_rq *wrq = (struct walt_rq *) rq->android_vendor_data1; - boost = sysctl_sched_load_boost[cpu]; - util_unboosted = util = freq_policy_load(rq); - util = div64_u64(util * (100 + boost), - walt_cpu_util_freq_divisor); + util = div64_u64(freq_policy_load(rq), + sched_ravg_window >> SCHED_CAPACITY_SHIFT); if (walt_load) { u64 nl = wrq->nt_prev_runnable_sum + wrq->grp_time.nt_prev_runnable_sum; u64 pl = wrq->walt_stats.pred_demands_sum_scaled; - /* do_pl_notif() needs unboosted signals */ - wrq->old_busy_time = div64_u64(util_unboosted, - sched_ravg_window >> - SCHED_CAPACITY_SHIFT); + wrq->old_busy_time = util; wrq->old_estimated_time = pl; - nl = div64_u64(nl * (100 + boost), walt_cpu_util_freq_divisor); - + nl = div64_u64(nl, sched_ravg_window >> SCHED_CAPACITY_SHIFT); walt_load->nl = nl; walt_load->pl = pl; walt_load->ws = walt_load_reported_window; @@ -3586,8 +3573,6 @@ void walt_fill_ta_data(struct core_ctl_notif_data *data) static void walt_init_window_dep(void) { - walt_cpu_util_freq_divisor = - (sched_ravg_window >> SCHED_CAPACITY_SHIFT) * 100; walt_scale_demand_divisor = sched_ravg_window >> SCHED_CAPACITY_SHIFT; sched_init_task_load_windows = diff --git a/kernel/sched/walt/walt.h b/kernel/sched/walt/walt.h index 92531e06000b..81413e9d26cb 100644 --- a/kernel/sched/walt/walt.h +++ b/kernel/sched/walt/walt.h @@ -313,7 +313,6 @@ extern enum sched_boost_policy boost_policy; extern unsigned int sysctl_input_boost_ms; extern unsigned int sysctl_input_boost_freq[8]; extern unsigned int sysctl_sched_boost_on_input; -extern unsigned int sysctl_sched_load_boost[WALT_NR_CPUS]; extern unsigned int sysctl_sched_user_hint; extern unsigned int sysctl_sched_conservative_pl; #define WALT_MANY_WAKEUP_DEFAULT 1000 @@ -508,18 +507,6 @@ static inline unsigned long cpu_util_cum(int cpu, int delta) return (delta >= capacity) ? capacity : delta; } -extern unsigned int capacity_margin_freq; - -static inline unsigned long -add_capacity_margin(unsigned long cpu_capacity, int cpu) -{ - cpu_capacity = cpu_capacity * capacity_margin_freq * - (100 + sysctl_sched_load_boost[cpu]); - cpu_capacity /= 100; - cpu_capacity /= SCHED_CAPACITY_SCALE; - return cpu_capacity; -} - static inline enum sched_boost_policy sched_boost_policy(void) { return boost_policy; diff --git a/kernel/sched/walt/walt_cfs.c b/kernel/sched/walt/walt_cfs.c index 9dbc9249ecfc..940c3f99e784 100644 --- a/kernel/sched/walt/walt_cfs.c +++ b/kernel/sched/walt/walt_cfs.c @@ -22,7 +22,6 @@ __read_mostly unsigned int sysctl_sched_prefer_spread; unsigned int sysctl_walt_rtg_cfs_boost_prio = 99; /* disabled by default */ unsigned int sched_small_task_threshold = 102; __read_mostly unsigned int sysctl_sched_force_lb_enable = 1; -unsigned int capacity_margin_freq = 1280; /* ~20% margin */ static inline bool prefer_spread_on_idle(int cpu, bool new_ilb) {