diff options
Diffstat (limited to 'litmus/litmus.c')
-rw-r--r-- | litmus/litmus.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/litmus/litmus.c b/litmus/litmus.c index 0756d0156f8f..8efd3f9ef7ee 100644 --- a/litmus/litmus.c +++ b/litmus/litmus.c | |||
@@ -382,7 +382,8 @@ void litmus_exit_task(struct task_struct* tsk) | |||
382 | /* IPI callback to synchronize plugin switching */ | 382 | /* IPI callback to synchronize plugin switching */ |
383 | static void synch_on_plugin_switch(void* info) | 383 | static void synch_on_plugin_switch(void* info) |
384 | { | 384 | { |
385 | while (atomic_read(&cannot_use_plugin)) | 385 | atomic_inc(&cannot_use_plugin); |
386 | while (atomic_read(&cannot_use_plugin) > 0) | ||
386 | cpu_relax(); | 387 | cpu_relax(); |
387 | } | 388 | } |
388 | 389 | ||
@@ -403,6 +404,10 @@ int switch_sched_plugin(struct sched_plugin* plugin) | |||
403 | /* send IPI to force other CPUs to synch with us */ | 404 | /* send IPI to force other CPUs to synch with us */ |
404 | smp_call_function(synch_on_plugin_switch, NULL, 0); | 405 | smp_call_function(synch_on_plugin_switch, NULL, 0); |
405 | 406 | ||
407 | /* wait until all other CPUs have started synch */ | ||
408 | while (atomic_read(&cannot_use_plugin) < num_online_cpus()) | ||
409 | cpu_relax(); | ||
410 | |||
406 | /* stop task transitions */ | 411 | /* stop task transitions */ |
407 | raw_spin_lock_irqsave(&task_transition_lock, flags); | 412 | raw_spin_lock_irqsave(&task_transition_lock, flags); |
408 | 413 | ||