diff options
author | Con Kolivas <kernel@kolivas.org> | 2017-08-15 14:34:38 +1000 |
---|---|---|
committer | Con Kolivas <kernel@kolivas.org> | 2017-08-15 14:35:23 +1000 |
commit | 616588b03c325a80ed985a56ed9086b2b0aa6e7b (patch) | |
tree | 4ede0e8b038260d7e96553818ca43ba16e5a70ab | |
parent | c3fabc79a75a585b943b47fce0e296fb2ff47001 (diff) |
Fix bind_zero working with set_task_cpu not taking queued tasks and bump MuQSS version to 0.160.4.12-muqss-160
-rw-r--r-- | kernel/sched/MuQSS.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/kernel/sched/MuQSS.c b/kernel/sched/MuQSS.c index 1e4a9342d4ef..8b78831df805 100644 --- a/kernel/sched/MuQSS.c +++ b/kernel/sched/MuQSS.c @@ -109,7 +109,7 @@ void print_scheduler_version(void) { - printk(KERN_INFO "MuQSS CPU scheduler v0.157 by Con Kolivas.\n"); + printk(KERN_INFO "MuQSS CPU scheduler v0.160 by Con Kolivas.\n"); } /* @@ -5789,24 +5789,35 @@ EXPORT_SYMBOL_GPL(set_cpus_allowed_ptr); static void bind_zero(int src_cpu) { struct task_struct *p, *t; + struct rq *rq0; int bound = 0; if (src_cpu == 0) return; + rq0 = cpu_rq(0); + do_each_thread(t, p) { if (cpumask_test_cpu(src_cpu, &p->cpus_allowed)) { bool local = (task_cpu(p) == src_cpu); + struct rq *rq = task_rq(p); /* task_running is the cpu stopper thread */ - if (local && task_running(task_rq(p), p)) + if (local && task_running(rq, p)) continue; atomic_clear_cpu(src_cpu, &p->cpus_allowed); atomic_set_cpu(0, &p->cpus_allowed); p->zerobound = true; bound++; - if (local) + if (local) { + bool queued = task_queued(p); + + if (queued) + dequeue_task(rq, p, 0); set_task_cpu(p, 0); + if (queued) + enqueue_task(rq0, p, 0); + } } } while_each_thread(t, p); |