From 2460840c1bc37a42bac0c2a212520dce24a13ebd Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Thu, 20 Oct 2016 06:27:39 +1100 Subject: [PATCH 57/80] Revert "Resched task when do_set_cpus_allowed is called from outside the scheduler code and drops affinity for the current cpu." This reverts commit 2932e2b7075ff5b8fd96f8d9d03db8532efdfc9d. --- kernel/sched/MuQSS.c | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/kernel/sched/MuQSS.c b/kernel/sched/MuQSS.c index e1fa0d1..e8101a3 100644 --- a/kernel/sched/MuQSS.c +++ b/kernel/sched/MuQSS.c @@ -5651,7 +5651,7 @@ void set_cpus_allowed_common(struct task_struct *p, const struct cpumask *new_ma p->nr_cpus_allowed = cpumask_weight(new_mask); } -static void __do_set_cpus_allowed(struct task_struct *p, const struct cpumask *new_mask) +void do_set_cpus_allowed(struct task_struct *p, const struct cpumask *new_mask) { struct rq *rq = task_rq(p); @@ -5666,21 +5666,6 @@ static void __do_set_cpus_allowed(struct task_struct *p, const struct cpumask *n */ lockdep_assert_held(&rq->lock); } -} - -void do_set_cpus_allowed(struct task_struct *p, const struct cpumask *new_mask) -{ - __do_set_cpus_allowed(p, new_mask); - if (needs_other_cpu(p, task_cpu(p))) { - set_task_cpu(p, valid_task_cpu(p)); - resched_task(p); - } -} - -static void _do_set_cpus_allowed(struct task_struct *p, const struct cpumask *new_mask) -{ - __do_set_cpus_allowed(p, new_mask); - /* __set_cpus_allowed_ptr will handle the reschedule in this variant */ if (needs_other_cpu(p, task_cpu(p))) set_task_cpu(p, valid_task_cpu(p)); } @@ -5938,7 +5923,7 @@ static int __set_cpus_allowed_ptr(struct task_struct *p, queued = task_queued(p); - _do_set_cpus_allowed(p, new_mask); + do_set_cpus_allowed(p, new_mask); if (p->flags & PF_KTHREAD) { /* -- 2.7.4