diff options
author | Mike Galbraith <efault@gmx.de> | 2009-01-29 14:06:52 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-01-29 14:25:23 +0100 |
commit | 65d370862f64973611a271ced61864b5f9bb6fc0 (patch) | |
tree | 353d54eefd2f014e3b7ae79c572ad0a0493f2403 /kernel/perf_counter.c | |
parent | bb3f0b59ad005d2d2ecbbe9bd048eab6d1ecbd31 (diff) | |
download | lwn-65d370862f64973611a271ced61864b5f9bb6fc0.tar.gz lwn-65d370862f64973611a271ced61864b5f9bb6fc0.zip |
perfcounters: fix refcounting bug
don't kfree in use counters.
Running...
while true; do perfstat -e 1 -c true; done
...on all cores for a while doesn't seem to be eating ram, and my oops
is gone.
Signed-off-by: Mike Galbraith <efault@gmx.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/perf_counter.c')
-rw-r--r-- | kernel/perf_counter.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/perf_counter.c b/kernel/perf_counter.c index 1ac18daa424f..f27a7e9f3c41 100644 --- a/kernel/perf_counter.c +++ b/kernel/perf_counter.c @@ -1934,7 +1934,8 @@ __perf_counter_exit_task(struct task_struct *child, } } - kfree(child_counter); + if (!child_counter->filp || !atomic_long_read(&child_counter->filp->f_count)) + kfree(child_counter); } /* |