Skip to content

Commit

Permalink
perf_counter: Move child perfcounter init to after scheduler init
Browse files Browse the repository at this point in the history
Initialize a task's perfcounters (inherit from parent, etc.) after
the child task's scheduler fields have been initialized already.

[ Impact: cleanup ]

Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: John Kacur <jkacur@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Ingo Molnar committed May 25, 2009
1 parent d94b943 commit e4cbb4e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/fork.c
Original file line number Diff line number Diff line change
Expand Up @@ -984,7 +984,6 @@ static struct task_struct *copy_process(unsigned long clone_flags,
goto fork_out;

rt_mutex_init_task(p);
perf_counter_init_task(p);

#ifdef CONFIG_PROVE_LOCKING
DEBUG_LOCKS_WARN_ON(!p->hardirqs_enabled);
Expand Down Expand Up @@ -1096,6 +1095,7 @@ static struct task_struct *copy_process(unsigned long clone_flags,

/* Perform scheduler related setup. Assign this task to a CPU. */
sched_fork(p, clone_flags);
perf_counter_init_task(p);

if ((retval = audit_alloc(p)))
goto bad_fork_cleanup_policy;
Expand Down

0 comments on commit e4cbb4e

Please sign in to comment.