Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 118506
b: refs/heads/master
c: 561920a
h: refs/heads/master
v: v3
  • Loading branch information
Suresh Siddha authored and Jens Axboe committed Nov 6, 2008
1 parent 6ac10a2 commit 5accb3c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 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: e78042e5b83936b1d12a4b5bbb492bdd88ad76c6
refs/heads/master: 561920a0d2bb6d63343e83acfd784c0a77bd28d1
18 changes: 12 additions & 6 deletions trunk/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,6 @@ static void csd_flag_wait(struct call_single_data *data)
{
/* Wait for response */
do {
/*
* We need to see the flags store in the IPI handler
*/
smp_mb();
if (!(data->flags & CSD_FLAG_WAIT))
break;
cpu_relax();
Expand All @@ -76,6 +72,11 @@ static void generic_exec_single(int cpu, struct call_single_data *data)
list_add_tail(&data->list, &dst->list);
spin_unlock_irqrestore(&dst->lock, flags);

/*
* Make the list addition visible before sending the ipi.
*/
smp_mb();

if (ipi)
arch_send_call_function_single_ipi(cpu);

Expand Down Expand Up @@ -157,7 +158,7 @@ void generic_smp_call_function_single_interrupt(void)
* Need to see other stores to list head for checking whether
* list is empty without holding q->lock
*/
smp_mb();
smp_read_barrier_depends();
while (!list_empty(&q->list)) {
unsigned int data_flags;

Expand Down Expand Up @@ -191,7 +192,7 @@ void generic_smp_call_function_single_interrupt(void)
/*
* See comment on outer loop
*/
smp_mb();
smp_read_barrier_depends();
}
}

Expand Down Expand Up @@ -370,6 +371,11 @@ int smp_call_function_mask(cpumask_t mask, void (*func)(void *), void *info,
list_add_tail_rcu(&data->csd.list, &call_function_queue);
spin_unlock_irqrestore(&call_function_lock, flags);

/*
* Make the list addition visible before sending the ipi.
*/
smp_mb();

/* Send a message to all CPUs in the map */
arch_send_call_function_ipi(mask);

Expand Down

0 comments on commit 5accb3c

Please sign in to comment.