Add a proc tunable of /proc/sys/kernel/interactive which is set to 1 by default and allows users to choose between prioritising latency or throughput. -ck --- kernel/sched/bfs.c | 21 +++++++++++++++------ kernel/sysctl.c | 10 ++++++++++ 2 files changed, 25 insertions(+), 6 deletions(-) Index: linux-4.3-ck3/kernel/sched/bfs.c =================================================================== --- linux-4.3-ck3.orig/kernel/sched/bfs.c 2015-12-15 17:01:01.885962087 +1100 +++ linux-4.3-ck3/kernel/sched/bfs.c 2015-12-15 17:01:01.883962099 +1100 @@ -135,7 +135,7 @@ void print_scheduler_version(void) { - printk(KERN_INFO "BFS CPU scheduler v0.466 by Con Kolivas.\n"); + printk(KERN_INFO "BFS CPU scheduler v0.467 by Con Kolivas.\n"); } /* @@ -145,6 +145,11 @@ void print_scheduler_version(void) */ int rr_interval __read_mostly = 6; +/* Tunable to choose whether to prioritise latency or throughput, simple + * binary yes or no */ + +int sched_interactive __read_mostly = 1; + /* * sched_iso_cpu - sysctl which determines the cpu percentage SCHED_ISO tasks * are allowed to run five seconds as real time tasks. This is the total over @@ -3188,7 +3193,6 @@ task_struct *earliest_deadline_task(stru */ earliest_deadline = ~0ULL; list_for_each_entry(p, queue, run_list) { - int tcpu; u64 dl; /* Make sure cpu affinity is ok */ @@ -3206,10 +3210,15 @@ task_struct *earliest_deadline_task(stru * against its deadline when not, based on cpu cache * locality. */ - tcpu = task_cpu(p); - if (tcpu != cpu && task_sticky(p) && scaling_rq(rq)) - continue; - dl = p->deadline << locality_diff(tcpu, rq); + if (sched_interactive) + dl = p->deadline; + else { + int tcpu = task_cpu(p); + + if (tcpu != cpu && task_sticky(p) && scaling_rq(rq)) + continue; + dl = p->deadline << locality_diff(tcpu, rq); + } if (deadline_before(dl, earliest_deadline)) { earliest_deadline = dl; Index: linux-4.3-ck3/kernel/sysctl.c =================================================================== --- linux-4.3-ck3.orig/kernel/sysctl.c 2015-12-15 17:01:01.885962087 +1100 +++ linux-4.3-ck3/kernel/sysctl.c 2015-12-15 17:01:01.883962099 +1100 @@ -127,6 +127,7 @@ static unsigned long one_ul = 1; static int __maybe_unused one_hundred = 100; #ifdef CONFIG_SCHED_BFS extern int rr_interval; +extern int sched_interactive; extern int sched_iso_cpu; static int __read_mostly one_thousand = 1000; #endif @@ -988,6 +989,15 @@ static struct ctl_table kern_table[] = { .extra2 = &one_thousand, }, { + .procname = "interactive", + .data = &sched_interactive, + .maxlen = sizeof(int), + .mode = 0644, + .proc_handler = &proc_dointvec_minmax, + .extra1 = &zero, + .extra2 = &one, + }, + { .procname = "iso_cpu", .data = &sched_iso_cpu, .maxlen = sizeof (int),