diff options
-rw-r--r-- | kernel/padata.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/kernel/padata.c b/kernel/padata.c index 5fa6ba6f11bd..fc9f19a00ae4 100644 --- a/kernel/padata.c +++ b/kernel/padata.c | |||
@@ -358,17 +358,15 @@ static struct parallel_data *padata_alloc_pd(struct padata_instance *pinst, | |||
358 | if (!alloc_cpumask_var(&pd->cpumask, GFP_KERNEL)) | 358 | if (!alloc_cpumask_var(&pd->cpumask, GFP_KERNEL)) |
359 | goto err_free_queue; | 359 | goto err_free_queue; |
360 | 360 | ||
361 | for_each_possible_cpu(cpu) { | 361 | cpumask_and(pd->cpumask, cpumask, cpu_active_mask); |
362 | |||
363 | for_each_cpu(cpu, pd->cpumask) { | ||
362 | queue = per_cpu_ptr(pd->queue, cpu); | 364 | queue = per_cpu_ptr(pd->queue, cpu); |
363 | 365 | ||
364 | queue->pd = pd; | 366 | queue->pd = pd; |
365 | 367 | ||
366 | if (cpumask_test_cpu(cpu, cpumask) | 368 | queue->cpu_index = cpu_index; |
367 | && cpumask_test_cpu(cpu, cpu_active_mask)) { | 369 | cpu_index++; |
368 | queue->cpu_index = cpu_index; | ||
369 | cpu_index++; | ||
370 | } else | ||
371 | queue->cpu_index = -1; | ||
372 | 370 | ||
373 | INIT_LIST_HEAD(&queue->reorder.list); | 371 | INIT_LIST_HEAD(&queue->reorder.list); |
374 | INIT_LIST_HEAD(&queue->parallel.list); | 372 | INIT_LIST_HEAD(&queue->parallel.list); |
@@ -382,8 +380,6 @@ static struct parallel_data *padata_alloc_pd(struct padata_instance *pinst, | |||
382 | atomic_set(&queue->num_obj, 0); | 380 | atomic_set(&queue->num_obj, 0); |
383 | } | 381 | } |
384 | 382 | ||
385 | cpumask_and(pd->cpumask, cpumask, cpu_active_mask); | ||
386 | |||
387 | num_cpus = cpumask_weight(pd->cpumask); | 383 | num_cpus = cpumask_weight(pd->cpumask); |
388 | pd->max_seq_nr = (MAX_SEQ_NR / num_cpus) * num_cpus - 1; | 384 | pd->max_seq_nr = (MAX_SEQ_NR / num_cpus) * num_cpus - 1; |
389 | 385 | ||