Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 147262
b: refs/heads/master
c: f160095
h: refs/heads/master
v: v3
  • Loading branch information
Peter Zijlstra authored and Ingo Molnar committed Apr 6, 2009
1 parent e136f29 commit 44e33c2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 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: 4a0deca657f3dbb8a707b5dc8f173beec01e7ed2
refs/heads/master: f16009527595ee562308653bc3d0039166d2ab15
11 changes: 8 additions & 3 deletions trunk/kernel/perf_counter.c
Original file line number Diff line number Diff line change
Expand Up @@ -1150,6 +1150,11 @@ static void free_counter_rcu(struct rcu_head *head)
kfree(counter);
}

static void free_counter(struct perf_counter *counter)
{
call_rcu(&counter->rcu_head, free_counter_rcu);
}

/*
* Called when the last reference to the file is gone.
*/
Expand All @@ -1168,7 +1173,7 @@ static int perf_release(struct inode *inode, struct file *file)
mutex_unlock(&counter->mutex);
mutex_unlock(&ctx->mutex);

call_rcu(&counter->rcu_head, free_counter_rcu);
free_counter(counter);
put_context(ctx);

return 0;
Expand Down Expand Up @@ -2128,10 +2133,10 @@ __perf_counter_exit_task(struct task_struct *child,
list_entry) {
if (sub->parent) {
sync_child_counter(sub, sub->parent);
kfree(sub);
free_counter(sub);
}
}
kfree(child_counter);
free_counter(child_counter);
}
}

Expand Down

0 comments on commit 44e33c2

Please sign in to comment.