aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/sched.c1
-rw-r--r--kernel/sched_fair.c10
2 files changed, 5 insertions, 6 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index c8759ec6d8a9..97986f1f0be8 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -858,7 +858,6 @@ static void dec_nr_running(struct task_struct *p, struct rq *rq)
858 858
859static void set_load_weight(struct task_struct *p) 859static void set_load_weight(struct task_struct *p)
860{ 860{
861 task_rq(p)->cfs.wait_runtime -= p->se.wait_runtime;
862 p->se.wait_runtime = 0; 861 p->se.wait_runtime = 0;
863 862
864 if (task_has_rt_policy(p)) { 863 if (task_has_rt_policy(p)) {
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
199static inline void 201static 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
210static inline struct rb_node *first_fair(struct cfs_rq *cfs_rq) 214static 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}