Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 349412
b: refs/heads/master
c: f44310b
h: refs/heads/master
v: v3
  • Loading branch information
Wang YanQing authored and Ingo Molnar committed Jan 28, 2013
1 parent 9bbc785 commit 20d0c24
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c903f0456bc69176912dee6dd25c6a66ee1aed00
refs/heads/master: f44310b98ddb7f0d06550d73ed67df5865e3eda5
13 changes: 12 additions & 1 deletion trunk/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ struct call_function_data {
struct call_single_data csd;
atomic_t refs;
cpumask_var_t cpumask;
cpumask_var_t cpumask_ipi;
};

static DEFINE_PER_CPU_SHARED_ALIGNED(struct call_function_data, cfd_data);
Expand All @@ -56,6 +57,9 @@ hotplug_cfd(struct notifier_block *nfb, unsigned long action, void *hcpu)
if (!zalloc_cpumask_var_node(&cfd->cpumask, GFP_KERNEL,
cpu_to_node(cpu)))
return notifier_from_errno(-ENOMEM);
if (!zalloc_cpumask_var_node(&cfd->cpumask_ipi, GFP_KERNEL,
cpu_to_node(cpu)))
return notifier_from_errno(-ENOMEM);
break;

#ifdef CONFIG_HOTPLUG_CPU
Expand All @@ -65,6 +69,7 @@ hotplug_cfd(struct notifier_block *nfb, unsigned long action, void *hcpu)
case CPU_DEAD:
case CPU_DEAD_FROZEN:
free_cpumask_var(cfd->cpumask);
free_cpumask_var(cfd->cpumask_ipi);
break;
#endif
};
Expand Down Expand Up @@ -526,6 +531,12 @@ void smp_call_function_many(const struct cpumask *mask,
return;
}

/*
* After we put an entry into the list, data->cpumask
* may be cleared again when another CPU sends another IPI for
* a SMP function call, so data->cpumask will be zero.
*/
cpumask_copy(data->cpumask_ipi, data->cpumask);
raw_spin_lock_irqsave(&call_function.lock, flags);
/*
* Place entry at the _HEAD_ of the list, so that any cpu still
Expand All @@ -549,7 +560,7 @@ void smp_call_function_many(const struct cpumask *mask,
smp_mb();

/* Send a message to all CPUs in the map */
arch_send_call_function_ipi_mask(data->cpumask);
arch_send_call_function_ipi_mask(data->cpumask_ipi);

/* Optionally wait for the CPUs to complete */
if (wait)
Expand Down

0 comments on commit 20d0c24

Please sign in to comment.