diff options
author | Stephane Eranian <eranian@google.com> | 2011-01-03 18:20:01 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2011-01-07 15:08:50 +0100 |
commit | 0b3fcf178deefd7b64154c2c0760a2c63df0b74f (patch) | |
tree | b84509c9ac5935ac41f6fc9c444bc406cd2c54d8 /kernel/exit.c | |
parent | 23a2f3ab46596d9fd0b0e592d2101bea90970594 (diff) | |
download | linux-0b3fcf178deefd7b64154c2c0760a2c63df0b74f.tar.gz linux-0b3fcf178deefd7b64154c2c0760a2c63df0b74f.tar.bz2 linux-0b3fcf178deefd7b64154c2c0760a2c63df0b74f.zip |
perf_events: Move code around to prepare for cgroup
In particular this patch move perf_event_exit_task() before
cgroup_exit() to allow for cgroup support. The cgroup_exit()
function detaches the cgroups attached to a task.
Other movements include hoisting some definitions and inlines
at the top of perf_event.c
Signed-off-by: Stephane Eranian <eranian@google.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <4d22058b.cdace30a.4657.ffff95b1@mx.google.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/exit.c')
-rw-r--r-- | kernel/exit.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/kernel/exit.c b/kernel/exit.c index 676149a4ac5f..8cb89045ecf3 100644 --- a/kernel/exit.c +++ b/kernel/exit.c @@ -994,6 +994,15 @@ NORET_TYPE void do_exit(long code) exit_fs(tsk); check_stack_usage(); exit_thread(); + + /* + * Flush inherited counters to the parent - before the parent + * gets woken up by child-exit notifications. + * + * because of cgroup mode, must be called before cgroup_exit() + */ + perf_event_exit_task(tsk); + cgroup_exit(tsk, 1); if (group_dead) @@ -1007,11 +1016,6 @@ NORET_TYPE void do_exit(long code) * FIXME: do that only when needed, using sched_exit tracepoint */ flush_ptrace_hw_breakpoint(tsk); - /* - * Flush inherited counters to the parent - before the parent - * gets woken up by child-exit notifications. - */ - perf_event_exit_task(tsk); exit_notify(tsk, group_dead); #ifdef CONFIG_NUMA |