diff --git a/include/linux/sched/sysctl.h b/include/linux/sched/sysctl.h index d9a15434b2db..2063a6f5cd96 100644 --- a/include/linux/sched/sysctl.h +++ b/include/linux/sched/sysctl.h @@ -56,6 +56,7 @@ extern unsigned int __weak sysctl_sched_many_wakeup_threshold; extern unsigned int __weak sysctl_sched_dynamic_ravg_window_enable; extern unsigned int sysctl_sched_prefer_spread; extern unsigned int sysctl_walt_rtg_cfs_boost_prio; +extern unsigned int sysctl_walt_low_latency_task_boost; extern int walt_proc_group_thresholds_handler(struct ctl_table *table, int write, diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 5d96dcef583b..1e38a977c012 100755 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -134,6 +134,7 @@ unsigned int sched_capacity_margin_down[NR_CPUS] = { #ifdef CONFIG_SCHED_WALT __read_mostly unsigned int sysctl_sched_prefer_spread; unsigned int sysctl_walt_rtg_cfs_boost_prio = 99; /* disabled by default */ +unsigned int sysctl_walt_low_latency_task_boost; /* disabled by default */ #endif unsigned int sched_small_task_threshold = 102; @@ -4077,7 +4078,7 @@ place_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int initial) TASK_BOOST_STRICT_MAX) vruntime -= sysctl_sched_latency; #ifdef CONFIG_SCHED_WALT - else if (task_of(se)->wts.low_latency || + else if (walt_low_latency_task(task_of(se)) || task_rtg_high_prio(task_of(se))) { vruntime -= sysctl_sched_latency; vruntime -= thresh; diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index 3ec26ac7d67b..4effae300f46 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -3004,6 +3004,11 @@ static inline struct walt_related_thread_group return rcu_dereference(p->wts.grp); } +static inline bool walt_low_latency_task(struct task_struct *p) +{ + return sysctl_walt_low_latency_task_boost && p->wts.low_latency; +} + /* Is frequency of two cpus synchronized with each other? */ static inline int same_freq_domain(int src_cpu, int dst_cpu) { diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 162d0c946de7..16b5ae77fba7 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -563,6 +563,15 @@ static struct ctl_table kern_table[] = { .extra1 = &min_cfs_boost_prio, .extra2 = &max_cfs_boost_prio, }, + { + .procname = "walt_low_latency_task_boost", + .data = &sysctl_walt_low_latency_task_boost, + .maxlen = sizeof(unsigned int), + .mode = 0644, + .proc_handler = proc_dointvec_minmax, + .extra1 = SYSCTL_ZERO, + .extra2 = SYSCTL_ONE, + }, #endif #ifdef CONFIG_SCHED_DEBUG {