Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 253795
b: refs/heads/master
c: afbee42
h: refs/heads/master
i:
  253793: 3767548
  253791: b83a1e2
v: v3
  • Loading branch information
Ingo Molnar committed Jun 13, 2011
1 parent 4a91f53 commit 325eea1
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: db5e7ecc4abc91b9f26f0c0d79ef88a51e987d90
refs/heads/master: afbee42706090fa59dac299c9607e4fd4361ec82
21 changes: 11 additions & 10 deletions trunk/drivers/oprofile/buffer_sync.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,15 +141,20 @@ static struct notifier_block module_load_nb = {
.notifier_call = module_load_notify,
};

static void free_all_tasks(void)
{
/* make sure we don't leak task structs */
process_task_mortuary();
process_task_mortuary();
}

int sync_start(void)
{
int err;

if (!zalloc_cpumask_var(&marked_cpus, GFP_KERNEL))
return -ENOMEM;

mutex_lock(&buffer_mutex);

err = task_handoff_register(&task_free_nb);
if (err)
goto out1;
Expand All @@ -166,14 +171,14 @@ int sync_start(void)
start_cpu_work();

out:
mutex_unlock(&buffer_mutex);
return err;
out4:
profile_event_unregister(PROFILE_MUNMAP, &munmap_nb);
out3:
profile_event_unregister(PROFILE_TASK_EXIT, &task_exit_nb);
out2:
task_handoff_unregister(&task_free_nb);
free_all_tasks();
out1:
free_cpumask_var(marked_cpus);
goto out;
Expand All @@ -182,20 +187,16 @@ int sync_start(void)

void sync_stop(void)
{
/* flush buffers */
mutex_lock(&buffer_mutex);
end_cpu_work();
unregister_module_notifier(&module_load_nb);
profile_event_unregister(PROFILE_MUNMAP, &munmap_nb);
profile_event_unregister(PROFILE_TASK_EXIT, &task_exit_nb);
task_handoff_unregister(&task_free_nb);
mutex_unlock(&buffer_mutex);
flush_cpu_work();
barrier(); /* do all of the above first */

/* make sure we don't leak task structs */
process_task_mortuary();
process_task_mortuary();
flush_cpu_work();

free_all_tasks();
free_cpumask_var(marked_cpus);
}

Expand Down
3 changes: 3 additions & 0 deletions trunk/fs/dcookies.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,8 @@ SYSCALL_DEFINE(lookup_dcookie)(u64 cookie64, char __user * buf, size_t len)
/* FIXME: (deleted) ? */
path = d_path(&dcs->path, kbuf, PAGE_SIZE);

mutex_unlock(&dcookie_mutex);

if (IS_ERR(path)) {
err = PTR_ERR(path);
goto out_free;
Expand All @@ -194,6 +196,7 @@ SYSCALL_DEFINE(lookup_dcookie)(u64 cookie64, char __user * buf, size_t len)

out_free:
kfree(kbuf);
return err;
out:
mutex_unlock(&dcookie_mutex);
return err;
Expand Down

0 comments on commit 325eea1

Please sign in to comment.