提交 65d37086 编写于 作者: M Mike Galbraith 提交者: Ingo Molnar

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: NMike Galbraith <efault@gmx.de>
Signed-off-by: NIngo Molnar <mingo@elte.hu>
上级 bb3f0b59
...@@ -1934,7 +1934,8 @@ __perf_counter_exit_task(struct task_struct *child, ...@@ -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);
} }
/* /*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册