|
@@ -155,8 +155,6 @@ int sync_start(void)
|
|
if (!zalloc_cpumask_var(&marked_cpus, GFP_KERNEL))
|
|
if (!zalloc_cpumask_var(&marked_cpus, GFP_KERNEL))
|
|
return -ENOMEM;
|
|
return -ENOMEM;
|
|
|
|
|
|
- mutex_lock(&buffer_mutex);
|
|
|
|
-
|
|
|
|
err = task_handoff_register(&task_free_nb);
|
|
err = task_handoff_register(&task_free_nb);
|
|
if (err)
|
|
if (err)
|
|
goto out1;
|
|
goto out1;
|
|
@@ -173,7 +171,6 @@ int sync_start(void)
|
|
start_cpu_work();
|
|
start_cpu_work();
|
|
|
|
|
|
out:
|
|
out:
|
|
- mutex_unlock(&buffer_mutex);
|
|
|
|
return err;
|
|
return err;
|
|
out4:
|
|
out4:
|
|
profile_event_unregister(PROFILE_MUNMAP, &munmap_nb);
|
|
profile_event_unregister(PROFILE_MUNMAP, &munmap_nb);
|
|
@@ -190,14 +187,13 @@ out1:
|
|
|
|
|
|
void sync_stop(void)
|
|
void sync_stop(void)
|
|
{
|
|
{
|
|
- /* flush buffers */
|
|
|
|
- mutex_lock(&buffer_mutex);
|
|
|
|
end_cpu_work();
|
|
end_cpu_work();
|
|
unregister_module_notifier(&module_load_nb);
|
|
unregister_module_notifier(&module_load_nb);
|
|
profile_event_unregister(PROFILE_MUNMAP, &munmap_nb);
|
|
profile_event_unregister(PROFILE_MUNMAP, &munmap_nb);
|
|
profile_event_unregister(PROFILE_TASK_EXIT, &task_exit_nb);
|
|
profile_event_unregister(PROFILE_TASK_EXIT, &task_exit_nb);
|
|
task_handoff_unregister(&task_free_nb);
|
|
task_handoff_unregister(&task_free_nb);
|
|
- mutex_unlock(&buffer_mutex);
|
|
|
|
|
|
+ barrier(); /* do all of the above first */
|
|
|
|
+
|
|
flush_cpu_work();
|
|
flush_cpu_work();
|
|
|
|
|
|
free_all_tasks();
|
|
free_all_tasks();
|