sched/core: Use tsk_cpus_allowed() instead of accessing ->cpus_allowed
authorThomas Gleixner <[email protected]>
Wed, 11 May 2016 12:23:30 +0000 (14:23 +0200)
committerIngo Molnar <[email protected]>
Thu, 12 May 2016 07:55:35 +0000 (09:55 +0200)
Use the future-safe accessor for struct task_struct's.

Signed-off-by: Thomas Gleixner <[email protected]>
Signed-off-by: Sebastian Andrzej Siewior <[email protected]>
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Mike Galbraith <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: [email protected]
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
kernel/sched/cpudeadline.c
kernel/sched/cpupri.c
kernel/sched/deadline.c

index 5a75b08cfd8576d830adf9fc9df52d807c052be9..5be58820465cced6c0d1dc06c9de146bddcf664f 100644 (file)
@@ -103,10 +103,10 @@ int cpudl_find(struct cpudl *cp, struct task_struct *p,
        const struct sched_dl_entity *dl_se = &p->dl;
 
        if (later_mask &&
-           cpumask_and(later_mask, cp->free_cpus, &p->cpus_allowed)) {
+           cpumask_and(later_mask, cp->free_cpus, tsk_cpus_allowed(p))) {
                best_cpu = cpumask_any(later_mask);
                goto out;
-       } else if (cpumask_test_cpu(cpudl_maximum(cp), &p->cpus_allowed) &&
+       } else if (cpumask_test_cpu(cpudl_maximum(cp), tsk_cpus_allowed(p)) &&
                        dl_time_before(dl_se->deadline, cp->elements[0].dl)) {
                best_cpu = cpudl_maximum(cp);
                if (later_mask)
index 981fcd7dc394eb10dd26113c66815dd0aa8e6a46..11e9705bf9378dafaecc1d1fe349841c5d014a60 100644 (file)
@@ -103,11 +103,11 @@ int cpupri_find(struct cpupri *cp, struct task_struct *p,
                if (skip)
                        continue;
 
-               if (cpumask_any_and(&p->cpus_allowed, vec->mask) >= nr_cpu_ids)
+               if (cpumask_any_and(tsk_cpus_allowed(p), vec->mask) >= nr_cpu_ids)
                        continue;
 
                if (lowest_mask) {
-                       cpumask_and(lowest_mask, &p->cpus_allowed, vec->mask);
+                       cpumask_and(lowest_mask, tsk_cpus_allowed(p), vec->mask);
 
                        /*
                         * We have to ensure that we have at least one bit
index 0ac6c84f33719813a31c9c906b564fef15307d93..4c9b4eee3f1c620730778a8684e26c490abe9f88 100644 (file)
@@ -1393,7 +1393,7 @@ static struct rq *find_lock_later_rq(struct task_struct *task, struct rq *rq)
                if (double_lock_balance(rq, later_rq)) {
                        if (unlikely(task_rq(task) != rq ||
                                     !cpumask_test_cpu(later_rq->cpu,
-                                                      &task->cpus_allowed) ||
+                                                      tsk_cpus_allowed(task)) ||
                                     task_running(rq, task) ||
                                     !dl_task(task) ||
                                     !task_on_rq_queued(task))) {