From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: jplozi Date: Fri, 11 Mar 2016 15:18:06 +0100 Subject: [PATCH] overload on wakeup source https://github.com/jplozi/wastedcores as an experiment, apply the learnings from the wasted-cores paper and see how the performance works out. With the data from this we should be able to work with Peter and the rest of the scheduler folks on a more permanent/elegant solution. --- kernel/sched/fair.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index c0c4d9ad7da8..a59694f24106 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -6693,6 +6693,20 @@ select_task_rq_fair(struct task_struct *p, int prev_cpu, int sd_flag, int wake_f } rcu_read_lock(); + + if (cpu_rq(prev_cpu)->nr_running) { + int _cpu; + + for_each_online_cpu(_cpu) { + if (!cpumask_test_cpu(_cpu, p->cpus_ptr) || + cpu_rq(_cpu)->nr_running) + continue; + + rcu_read_unlock(); + return _cpu; + } + } + for_each_domain(cpu, tmp) { /* * If both 'cpu' and 'prev_cpu' are part of this domain, -- https://clearlinux.org