Messages in this thread Patch in this message |  | | From | Scott Wood <> | Subject | [PATCH RT 4/8] sched: migrate disable: Protect cpus_ptr with lock | Date | Sat, 27 Jul 2019 00:56:34 -0500 |
| |
Various places assume that cpus_ptr is protected by rq/pi locks, so don't change it before grabbing those locks.
Signed-off-by: Scott Wood <swood@redhat.com> --- kernel/sched/core.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 99a3cfccf4d3..38a9a9df5638 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -7283,9 +7283,8 @@ void dump_cpu_task(int cpu) struct rq *rq; struct rq_flags rf; - p->cpus_ptr = cpumask_of(smp_processor_id()); - rq = task_rq_lock(p, &rf); + p->cpus_ptr = cpumask_of(smp_processor_id()); update_nr_migratory(p, -1); p->nr_cpus_allowed = 1; task_rq_unlock(rq, p, &rf); @@ -7297,9 +7296,8 @@ void dump_cpu_task(int cpu) struct rq *rq; struct rq_flags rf; - p->cpus_ptr = &p->cpus_mask; - rq = task_rq_lock(p, &rf); + p->cpus_ptr = &p->cpus_mask; p->nr_cpus_allowed = cpumask_weight(&p->cpus_mask); update_nr_migratory(p, 1); task_rq_unlock(rq, p, &rf); -- 1.8.3.1
|  |