diff --git a/include/linux/sched/sysctl.h b/include/linux/sched/sysctl.h index 2063a6f5cd96..090d7ef6c909 100644 --- a/include/linux/sched/sysctl.h +++ b/include/linux/sched/sysctl.h @@ -56,7 +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 unsigned int sysctl_walt_low_latency_task_threshold; extern int walt_proc_group_thresholds_handler(struct ctl_table *table, int write, diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h index 6726ab06285a..8795bb04541a 100644 --- a/include/trace/events/sched.h +++ b/include/trace/events/sched.h @@ -1052,7 +1052,7 @@ TRACE_EVENT(sched_task_util, __entry->cpus_allowed = cpumask_bits(&p->cpus_mask)[0]; __entry->task_boost = per_task_boost(p); - __entry->low_latency = p->wts.low_latency; + __entry->low_latency = walt_low_latency_task(p); ), TP_printk("pid=%d comm=%s util=%lu prev_cpu=%d candidates=%#lx best_energy_cpu=%d sync=%d need_idle=%d fastpath=%d placement_boost=%d latency=%llu stune_boosted=%d is_rtg=%d rtg_skip_min=%d start_cpu=%d unfilter=%u affinity=%lx task_boost=%d low_latency=%d", diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 248339578c16..c6ce899b29f9 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -135,7 +135,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 */ +unsigned int sysctl_walt_low_latency_task_threshold; /* disabled by default */ #endif unsigned int sched_small_task_threshold = 102; diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index 4effae300f46..79b175a65e0e 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -3006,7 +3006,8 @@ static inline struct walt_related_thread_group static inline bool walt_low_latency_task(struct task_struct *p) { - return sysctl_walt_low_latency_task_boost && p->wts.low_latency; + return p->wts.low_latency && + (task_util(p) < sysctl_walt_low_latency_task_threshold); } /* Is frequency of two cpus synchronized with each other? */ diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 16b5ae77fba7..02b12e9b14c2 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -564,13 +564,13 @@ static struct ctl_table kern_table[] = { .extra2 = &max_cfs_boost_prio, }, { - .procname = "walt_low_latency_task_boost", - .data = &sysctl_walt_low_latency_task_boost, + .procname = "walt_low_latency_task_threshold", + .data = &sysctl_walt_low_latency_task_threshold, .maxlen = sizeof(unsigned int), .mode = 0644, .proc_handler = proc_dointvec_minmax, .extra1 = SYSCTL_ZERO, - .extra2 = SYSCTL_ONE, + .extra2 = &one_thousand, }, #endif #ifdef CONFIG_SCHED_DEBUG