Merge "sched: walt: resurrect walt_high_irqload tunable"

This commit is contained in:
qctecmdr 2021-07-18 20:02:08 -07:00 committed by Gerrit - the friendly Code Review server
commit 20a7522917
3 changed files with 40 additions and 1 deletions

View File

@ -62,6 +62,7 @@ extern unsigned int sysctl_sched_prefer_spread;
extern unsigned int sysctl_walt_rtg_cfs_boost_prio;
extern unsigned int sysctl_walt_low_latency_task_threshold;
extern unsigned int sysctl_sched_sync_hint_enable;
extern unsigned int sysctl_walt_cpu_high_irqload;
extern int
walt_proc_group_thresholds_handler(struct ctl_table *table, int write,
@ -87,6 +88,10 @@ extern int sched_boost_handler(struct ctl_table *table, int write,
extern int sched_busy_hyst_handler(struct ctl_table *table, int write,
void __user *buffer, size_t *lenp, loff_t *ppos);
extern int walt_high_irqload_handler(struct ctl_table *table, int write,
void __user *buffer, size_t *lenp, loff_t *ppos);
#endif
enum sched_tunable_scaling {

View File

@ -111,6 +111,8 @@ unsigned int sysctl_sched_capacity_margin_up[MAX_MARGIN_LEVELS] = {
[0 ... MAX_MARGIN_LEVELS-1] = 1078}; /* ~5% margin */
unsigned int sysctl_sched_capacity_margin_down[MAX_MARGIN_LEVELS] = {
[0 ... MAX_MARGIN_LEVELS-1] = 1205}; /* ~15% margin */
unsigned int sysctl_walt_cpu_high_irqload = 95;
static unsigned int walt_cpu_high_irqload;
unsigned int sysctl_sched_walt_rotate_big_tasks;
@ -3666,6 +3668,26 @@ int walt_proc_group_thresholds_handler(struct ctl_table *table, int write,
return ret;
}
int walt_high_irqload_handler(struct ctl_table *table, int write,
void __user *buffer, size_t *lenp, loff_t *ppos)
{
int ret;
static DEFINE_MUTEX(mutex);
mutex_lock(&mutex);
ret = proc_dointvec_minmax(table, write, buffer, lenp, ppos);
if (ret || !write) {
mutex_unlock(&mutex);
return ret;
}
walt_cpu_high_irqload = div64_u64((u64)sched_ravg_window *
sysctl_walt_cpu_high_irqload, (u64) 100);
mutex_unlock(&mutex);
return ret;
}
static void walt_init_window_dep(void)
{
walt_cpu_util_freq_divisor =
@ -3678,7 +3700,8 @@ static void walt_init_window_dep(void)
sched_init_task_load_windows_scaled =
scale_demand(sched_init_task_load_windows);
walt_cpu_high_irqload = div64_u64((u64)sched_ravg_window * 95, (u64) 100);
walt_cpu_high_irqload = mult_frac((u64)sched_ravg_window,
sysctl_walt_cpu_high_irqload, (u64) 100);
}
static void walt_init_once(void)

View File

@ -149,6 +149,7 @@ static int __maybe_unused max_kswapd_threads = MAX_KSWAPD_THREADS;
#ifdef CONFIG_SCHED_WALT
static int neg_three = -3;
static int three = 3;
static int fifty = 50;
static int two_hundred_fifty_five = 255;
const int sched_user_hint_max = 1000;
static unsigned int ns_per_sec = NSEC_PER_SEC;
@ -594,6 +595,16 @@ static struct ctl_table kern_table[] = {
.mode = 0644,
.proc_handler = proc_dointvec,
},
{
.procname = "sched_cpu_high_irqload",
.data = &sysctl_walt_cpu_high_irqload,
.maxlen = sizeof(unsigned int),
.mode = 0644,
.proc_handler = walt_high_irqload_handler,
.extra1 = &fifty,
.extra2 = &one_hundred,
},
#endif
{
.procname = "sched_force_lb_enable",