Skip to content

Commit

Permalink
padata: Use the online cpumask as the default
Browse files Browse the repository at this point in the history
We use the active cpumask to determine the superset of cpus
to use for parallelization. However, the active cpumask is
for internal usage of the scheduler and therefore not the
appropriate cpumask for these purposes. So use the online
cpumask instead.

Reported-by: Peter Zijlstra <[email protected]>
Signed-off-by: Steffen Klassert <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
klassert authored and herbertx committed Mar 29, 2012
1 parent 107f8bd commit 13614e0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions kernel/padata.c
Original file line number Diff line number Diff line change
Expand Up @@ -356,13 +356,13 @@ static int padata_setup_cpumasks(struct parallel_data *pd,
if (!alloc_cpumask_var(&pd->cpumask.pcpu, GFP_KERNEL))
return -ENOMEM;

cpumask_and(pd->cpumask.pcpu, pcpumask, cpu_active_mask);
cpumask_and(pd->cpumask.pcpu, pcpumask, cpu_online_mask);
if (!alloc_cpumask_var(&pd->cpumask.cbcpu, GFP_KERNEL)) {
free_cpumask_var(pd->cpumask.cbcpu);
return -ENOMEM;
}

cpumask_and(pd->cpumask.cbcpu, cbcpumask, cpu_active_mask);
cpumask_and(pd->cpumask.cbcpu, cbcpumask, cpu_online_mask);
return 0;
}

Expand Down Expand Up @@ -566,7 +566,7 @@ EXPORT_SYMBOL(padata_unregister_cpumask_notifier);
static bool padata_validate_cpumask(struct padata_instance *pinst,
const struct cpumask *cpumask)
{
if (!cpumask_intersects(cpumask, cpu_active_mask)) {
if (!cpumask_intersects(cpumask, cpu_online_mask)) {
pinst->flags |= PADATA_INVALID;
return false;
}
Expand Down Expand Up @@ -680,7 +680,7 @@ static int __padata_add_cpu(struct padata_instance *pinst, int cpu)
{
struct parallel_data *pd;

if (cpumask_test_cpu(cpu, cpu_active_mask)) {
if (cpumask_test_cpu(cpu, cpu_online_mask)) {
pd = padata_alloc_pd(pinst, pinst->cpumask.pcpu,
pinst->cpumask.cbcpu);
if (!pd)
Expand Down

0 comments on commit 13614e0

Please sign in to comment.