diff options
author | Ingo Molnar <mingo@elte.hu> | 2007-09-05 08:32:49 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2007-09-05 08:32:49 -0400 |
commit | a206c07213cf6372289f189c3774c4c3255a7ae1 (patch) | |
tree | a13c33021cc7e7b656305cf20f96205c5f5745a9 /kernel/sched_fair.c | |
parent | a0dc72601d48b171b4870dfdd0824901a2b2b1a9 (diff) |
sched: debug: fix cfs_rq->wait_runtime accounting
the cfs_rq->wait_runtime debug/statistics counter was not maintained
properly - fix this.
this also removes some code:
text data bss dec hex filename
13420 228 1204 14852 3a04 sched.o.before
13404 228 1204 14836 39f4 sched.o.after
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Diffstat (limited to 'kernel/sched_fair.c')
-rw-r--r-- | kernel/sched_fair.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c index 810b52d994e0..bac2aff8273c 100644 --- a/kernel/sched_fair.c +++ b/kernel/sched_fair.c | |||
@@ -194,6 +194,8 @@ __enqueue_entity(struct cfs_rq *cfs_rq, struct sched_entity *se) | |||
194 | update_load_add(&cfs_rq->load, se->load.weight); | 194 | update_load_add(&cfs_rq->load, se->load.weight); |
195 | cfs_rq->nr_running++; | 195 | cfs_rq->nr_running++; |
196 | se->on_rq = 1; | 196 | se->on_rq = 1; |
197 | |||
198 | schedstat_add(cfs_rq, wait_runtime, se->wait_runtime); | ||
197 | } | 199 | } |
198 | 200 | ||
199 | static inline void | 201 | static inline void |
@@ -205,6 +207,8 @@ __dequeue_entity(struct cfs_rq *cfs_rq, struct sched_entity *se) | |||
205 | update_load_sub(&cfs_rq->load, se->load.weight); | 207 | update_load_sub(&cfs_rq->load, se->load.weight); |
206 | cfs_rq->nr_running--; | 208 | cfs_rq->nr_running--; |
207 | se->on_rq = 0; | 209 | se->on_rq = 0; |
210 | |||
211 | schedstat_add(cfs_rq, wait_runtime, -se->wait_runtime); | ||
208 | } | 212 | } |
209 | 213 | ||
210 | static inline struct rb_node *first_fair(struct cfs_rq *cfs_rq) | 214 | static inline struct rb_node *first_fair(struct cfs_rq *cfs_rq) |
@@ -574,7 +578,6 @@ static void __enqueue_sleeper(struct cfs_rq *cfs_rq, struct sched_entity *se) | |||
574 | 578 | ||
575 | prev_runtime = se->wait_runtime; | 579 | prev_runtime = se->wait_runtime; |
576 | __add_wait_runtime(cfs_rq, se, delta_fair); | 580 | __add_wait_runtime(cfs_rq, se, delta_fair); |
577 | schedstat_add(cfs_rq, wait_runtime, se->wait_runtime); | ||
578 | delta_fair = se->wait_runtime - prev_runtime; | 581 | delta_fair = se->wait_runtime - prev_runtime; |
579 | 582 | ||
580 | /* | 583 | /* |
@@ -662,7 +665,6 @@ dequeue_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int sleep) | |||
662 | if (tsk->state & TASK_UNINTERRUPTIBLE) | 665 | if (tsk->state & TASK_UNINTERRUPTIBLE) |
663 | se->block_start = rq_of(cfs_rq)->clock; | 666 | se->block_start = rq_of(cfs_rq)->clock; |
664 | } | 667 | } |
665 | cfs_rq->wait_runtime -= se->wait_runtime; | ||
666 | #endif | 668 | #endif |
667 | } | 669 | } |
668 | __dequeue_entity(cfs_rq, se); | 670 | __dequeue_entity(cfs_rq, se); |
@@ -1121,10 +1123,8 @@ static void task_new_fair(struct rq *rq, struct task_struct *p) | |||
1121 | * The statistical average of wait_runtime is about | 1123 | * The statistical average of wait_runtime is about |
1122 | * -granularity/2, so initialize the task with that: | 1124 | * -granularity/2, so initialize the task with that: |
1123 | */ | 1125 | */ |
1124 | if (sysctl_sched_features & SCHED_FEAT_START_DEBIT) { | 1126 | if (sysctl_sched_features & SCHED_FEAT_START_DEBIT) |
1125 | se->wait_runtime = -(sched_granularity(cfs_rq) / 2); | 1127 | se->wait_runtime = -(sched_granularity(cfs_rq) / 2); |
1126 | schedstat_add(cfs_rq, wait_runtime, se->wait_runtime); | ||
1127 | } | ||
1128 | 1128 | ||
1129 | __enqueue_entity(cfs_rq, se); | 1129 | __enqueue_entity(cfs_rq, se); |
1130 | } | 1130 | } |