aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorDaniel Walker <dwalker@mvista.com>2008-02-06 04:37:41 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-06 13:41:08 -0500
commit6c6080f74c8d83a83a1e36bce803de15c0633898 (patch)
treefd017cd3697ca30a169572018e88bf628983509b /kernel
parentbcf11cbeccd7d981d68567942ba6ec184890bc29 (diff)
stopmachine: semaphore to mutex
[akpm@linux-foundation.org: cleanup] Signed-off-by: Daniel Walker <dwalker@mvista.com> Acked-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/stop_machine.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/kernel/stop_machine.c b/kernel/stop_machine.c
index 51b5ee53571a..6f4e0e13f70c 100644
--- a/kernel/stop_machine.c
+++ b/kernel/stop_machine.c
@@ -29,7 +29,6 @@ enum stopmachine_state {
29static enum stopmachine_state stopmachine_state; 29static enum stopmachine_state stopmachine_state;
30static unsigned int stopmachine_num_threads; 30static unsigned int stopmachine_num_threads;
31static atomic_t stopmachine_thread_ack; 31static atomic_t stopmachine_thread_ack;
32static DECLARE_MUTEX(stopmachine_mutex);
33 32
34static int stopmachine(void *cpu) 33static int stopmachine(void *cpu)
35{ 34{
@@ -170,6 +169,7 @@ static int do_stop(void *_smdata)
170struct task_struct *__stop_machine_run(int (*fn)(void *), void *data, 169struct task_struct *__stop_machine_run(int (*fn)(void *), void *data,
171 unsigned int cpu) 170 unsigned int cpu)
172{ 171{
172 static DEFINE_MUTEX(stopmachine_mutex);
173 struct stop_machine_data smdata; 173 struct stop_machine_data smdata;
174 struct task_struct *p; 174 struct task_struct *p;
175 175
@@ -177,7 +177,7 @@ struct task_struct *__stop_machine_run(int (*fn)(void *), void *data,
177 smdata.data = data; 177 smdata.data = data;
178 init_completion(&smdata.done); 178 init_completion(&smdata.done);
179 179
180 down(&stopmachine_mutex); 180 mutex_lock(&stopmachine_mutex);
181 181
182 /* If they don't care which CPU fn runs on, bind to any online one. */ 182 /* If they don't care which CPU fn runs on, bind to any online one. */
183 if (cpu == NR_CPUS) 183 if (cpu == NR_CPUS)
@@ -193,7 +193,7 @@ struct task_struct *__stop_machine_run(int (*fn)(void *), void *data,
193 wake_up_process(p); 193 wake_up_process(p);
194 wait_for_completion(&smdata.done); 194 wait_for_completion(&smdata.done);
195 } 195 }
196 up(&stopmachine_mutex); 196 mutex_unlock(&stopmachine_mutex);
197 return p; 197 return p;
198} 198}
199 199