diff --git a/patches/5.15/tt-5.15.patch b/patches/5.15/tt-5.15.patch index 8d183a2..d6b51c1 100644 --- a/patches/5.15/tt-5.15.patch +++ b/patches/5.15/tt-5.15.patch @@ -140,10 +140,10 @@ index 978fcfca5871..bfde8e0d851b 100644 obj-$(CONFIG_SMP) += cpupri.o cpudeadline.o topology.o stop_task.o pelt.o diff --git a/kernel/sched/bs.c b/kernel/sched/bs.c new file mode 100644 -index 000000000000..ad79be3d4c45 +index 000000000000..8c1097870394 --- /dev/null +++ b/kernel/sched/bs.c -@@ -0,0 +1,1876 @@ +@@ -0,0 +1,1888 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * TT Scheduler Class (SCHED_NORMAL/SCHED_BATCH) @@ -1186,6 +1186,7 @@ index 000000000000..ad79be3d4c45 + int target = -1, cpu; + struct tt_node *ttn = &p->se.tt_node; + unsigned int min = ~0; ++ bool all_non_idle = true; + + /* + * If type is realtime, interactive, or no type, @@ -1198,8 +1199,10 @@ index 000000000000..ad79be3d4c45 + if (unlikely(!cpumask_test_cpu(cpu, p->cpus_ptr))) + continue; + -+ if (idle_cpu(cpu)) ++ if (idle_cpu(cpu)) { ++ all_non_idle = false; + continue; ++ } + + if (cpu_rq(cpu)->nr_running < min) { + target = cpu; @@ -1207,6 +1210,15 @@ index 000000000000..ad79be3d4c45 + } + } + ++ /* ++ * If all cpus are non-idle, then fallback ++ * to normal TT balancing. Since no energy ++ * saving at this point, at least try to ++ * use cpu affain. ++ */ ++ if (all_non_idle) ++ return -1; ++ + return target; +} +