diff options
author | Lucas De Marchi <lucas.de.marchi@gmail.com> | 2009-07-09 07:57:20 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-07-10 04:43:29 -0400 |
commit | 7793527b90d9418211f4fe8464cc1dcb1631ea1b (patch) | |
tree | a09cdbe3942d9ba22877976737a220f9aaac2a04 /kernel/sched.c | |
parent | a1ba4d8ba9f06a397e97cbd67a93ee306860b40a (diff) |
sched: Reset sched stats on fork()
The sched_stat fields are currently not reset upon fork.
Ingo's recent commit 6c594c21fcb02c662f11c97be4d7d2b73060a205
did reset nr_migrations, but it didn't reset any of the
others.
This patch resets all sched_stat fields on fork.
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <193b0f820907090457s7a3662f4gcdecdc22fcae857b@mail.gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/sched.c')
-rw-r--r-- | kernel/sched.c | 40 |
1 files changed, 31 insertions, 9 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index a17f3d9a8bfa..c4549bd7e174 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -2572,15 +2572,37 @@ static void __sched_fork(struct task_struct *p) | |||
2572 | p->se.avg_wakeup = sysctl_sched_wakeup_granularity; | 2572 | p->se.avg_wakeup = sysctl_sched_wakeup_granularity; |
2573 | 2573 | ||
2574 | #ifdef CONFIG_SCHEDSTATS | 2574 | #ifdef CONFIG_SCHEDSTATS |
2575 | p->se.wait_start = 0; | 2575 | p->se.wait_start = 0; |
2576 | p->se.sum_sleep_runtime = 0; | 2576 | p->se.wait_max = 0; |
2577 | p->se.sleep_start = 0; | 2577 | p->se.wait_count = 0; |
2578 | p->se.block_start = 0; | 2578 | p->se.wait_sum = 0; |
2579 | p->se.sleep_max = 0; | 2579 | |
2580 | p->se.block_max = 0; | 2580 | p->se.sleep_start = 0; |
2581 | p->se.exec_max = 0; | 2581 | p->se.sleep_max = 0; |
2582 | p->se.slice_max = 0; | 2582 | p->se.sum_sleep_runtime = 0; |
2583 | p->se.wait_max = 0; | 2583 | |
2584 | p->se.block_start = 0; | ||
2585 | p->se.block_max = 0; | ||
2586 | p->se.exec_max = 0; | ||
2587 | p->se.slice_max = 0; | ||
2588 | |||
2589 | p->se.nr_migrations_cold = 0; | ||
2590 | p->se.nr_failed_migrations_affine = 0; | ||
2591 | p->se.nr_failed_migrations_running = 0; | ||
2592 | p->se.nr_failed_migrations_hot = 0; | ||
2593 | p->se.nr_forced_migrations = 0; | ||
2594 | p->se.nr_forced2_migrations = 0; | ||
2595 | |||
2596 | p->se.nr_wakeups = 0; | ||
2597 | p->se.nr_wakeups_sync = 0; | ||
2598 | p->se.nr_wakeups_migrate = 0; | ||
2599 | p->se.nr_wakeups_local = 0; | ||
2600 | p->se.nr_wakeups_remote = 0; | ||
2601 | p->se.nr_wakeups_affine = 0; | ||
2602 | p->se.nr_wakeups_affine_attempts = 0; | ||
2603 | p->se.nr_wakeups_passive = 0; | ||
2604 | p->se.nr_wakeups_idle = 0; | ||
2605 | |||
2584 | #endif | 2606 | #endif |
2585 | 2607 | ||
2586 | INIT_LIST_HEAD(&p->rt.run_list); | 2608 | INIT_LIST_HEAD(&p->rt.run_list); |