diff options
author | Steffen Klassert <steffen.klassert@secunet.com> | 2010-04-29 08:41:36 -0400 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2010-05-02 23:32:11 -0400 |
commit | 7b389b2cc539dc2dc60b049240942be54958c93a (patch) | |
tree | 7ab93b0052445c147d88c4479d7b0994769c671c /kernel/padata.c | |
parent | 7d0d2d385ca7cc511f7d1c64735a1b4aaefd9a1b (diff) |
padata: Initialize the padata queues only for the used cpus
padata_alloc_pd set up queues for all possible cpus.
This patch changes this to set up the queues just for
the used cpus.
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'kernel/padata.c')
-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 | ||