diff options
Diffstat (limited to 'kernel/smp.c')
| -rw-r--r-- | kernel/smp.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/kernel/smp.c b/kernel/smp.c index f362a8553777..75c8dde58c55 100644 --- a/kernel/smp.c +++ b/kernel/smp.c | |||
| @@ -51,10 +51,6 @@ static void csd_flag_wait(struct call_single_data *data) | |||
| 51 | { | 51 | { |
| 52 | /* Wait for response */ | 52 | /* Wait for response */ |
| 53 | do { | 53 | do { |
| 54 | /* | ||
| 55 | * We need to see the flags store in the IPI handler | ||
| 56 | */ | ||
| 57 | smp_mb(); | ||
| 58 | if (!(data->flags & CSD_FLAG_WAIT)) | 54 | if (!(data->flags & CSD_FLAG_WAIT)) |
| 59 | break; | 55 | break; |
| 60 | cpu_relax(); | 56 | cpu_relax(); |
| @@ -76,6 +72,11 @@ static void generic_exec_single(int cpu, struct call_single_data *data) | |||
| 76 | list_add_tail(&data->list, &dst->list); | 72 | list_add_tail(&data->list, &dst->list); |
| 77 | spin_unlock_irqrestore(&dst->lock, flags); | 73 | spin_unlock_irqrestore(&dst->lock, flags); |
| 78 | 74 | ||
| 75 | /* | ||
| 76 | * Make the list addition visible before sending the ipi. | ||
| 77 | */ | ||
| 78 | smp_mb(); | ||
| 79 | |||
| 79 | if (ipi) | 80 | if (ipi) |
| 80 | arch_send_call_function_single_ipi(cpu); | 81 | arch_send_call_function_single_ipi(cpu); |
| 81 | 82 | ||
| @@ -157,7 +158,7 @@ void generic_smp_call_function_single_interrupt(void) | |||
| 157 | * Need to see other stores to list head for checking whether | 158 | * Need to see other stores to list head for checking whether |
| 158 | * list is empty without holding q->lock | 159 | * list is empty without holding q->lock |
| 159 | */ | 160 | */ |
| 160 | smp_mb(); | 161 | smp_read_barrier_depends(); |
| 161 | while (!list_empty(&q->list)) { | 162 | while (!list_empty(&q->list)) { |
| 162 | unsigned int data_flags; | 163 | unsigned int data_flags; |
| 163 | 164 | ||
| @@ -191,7 +192,7 @@ void generic_smp_call_function_single_interrupt(void) | |||
| 191 | /* | 192 | /* |
| 192 | * See comment on outer loop | 193 | * See comment on outer loop |
| 193 | */ | 194 | */ |
| 194 | smp_mb(); | 195 | smp_read_barrier_depends(); |
| 195 | } | 196 | } |
| 196 | } | 197 | } |
| 197 | 198 | ||
| @@ -370,6 +371,11 @@ int smp_call_function_mask(cpumask_t mask, void (*func)(void *), void *info, | |||
| 370 | list_add_tail_rcu(&data->csd.list, &call_function_queue); | 371 | list_add_tail_rcu(&data->csd.list, &call_function_queue); |
| 371 | spin_unlock_irqrestore(&call_function_lock, flags); | 372 | spin_unlock_irqrestore(&call_function_lock, flags); |
| 372 | 373 | ||
| 374 | /* | ||
| 375 | * Make the list addition visible before sending the ipi. | ||
| 376 | */ | ||
| 377 | smp_mb(); | ||
| 378 | |||
| 373 | /* Send a message to all CPUs in the map */ | 379 | /* Send a message to all CPUs in the map */ |
| 374 | arch_send_call_function_ipi(mask); | 380 | arch_send_call_function_ipi(mask); |
| 375 | 381 | ||
