aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/kernel/smp.c
diff options
context:
space:
mode:
authorHeiko Carstens <heiko.carstens@de.ibm.com>2007-07-27 06:29:09 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2007-07-27 06:29:17 -0400
commit8da1aecde00b74d63123e6031155bbb1424b338d (patch)
treea743032ff75c67e290093a8fe38884e41bbca938 /arch/s390/kernel/smp.c
parent3bb447fc8bb6523cb1cec7a0277d831a2b0462b7 (diff)
[S390] Improve __smp_call_function_map.
There is no need to disable bottom halves when holding call_lock. Also this could imply that it is legal to call smp_call_function* from bh context, which it is not. Also test if func will be executed locally before disabling and aterwards enabling interrupts again. It's not necessary to disable and enable interrupts each time __smp_call_function_map gets called. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/kernel/smp.c')
-rw-r--r--arch/s390/kernel/smp.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c
index aff9f853fc30..03674fbe598f 100644
--- a/arch/s390/kernel/smp.c
+++ b/arch/s390/kernel/smp.c
@@ -120,7 +120,7 @@ static void __smp_call_function_map(void (*func) (void *info), void *info,
120 if (wait) 120 if (wait)
121 data.finished = CPU_MASK_NONE; 121 data.finished = CPU_MASK_NONE;
122 122
123 spin_lock_bh(&call_lock); 123 spin_lock(&call_lock);
124 call_data = &data; 124 call_data = &data;
125 125
126 for_each_cpu_mask(cpu, map) 126 for_each_cpu_mask(cpu, map)
@@ -129,18 +129,16 @@ static void __smp_call_function_map(void (*func) (void *info), void *info,
129 /* Wait for response */ 129 /* Wait for response */
130 while (!cpus_equal(map, data.started)) 130 while (!cpus_equal(map, data.started))
131 cpu_relax(); 131 cpu_relax();
132
133 if (wait) 132 if (wait)
134 while (!cpus_equal(map, data.finished)) 133 while (!cpus_equal(map, data.finished))
135 cpu_relax(); 134 cpu_relax();
136 135 spin_unlock(&call_lock);
137 spin_unlock_bh(&call_lock);
138
139out: 136out:
140 local_irq_disable(); 137 if (local) {
141 if (local) 138 local_irq_disable();
142 func(info); 139 func(info);
143 local_irq_enable(); 140 local_irq_enable();
141 }
144} 142}
145 143
146/* 144/*