From: Mark Brown Date: Wed, 22 Jan 2014 11:18:53 +0000 (+0000) Subject: HMP: Drop "sched: Fix sleep time double accounting in enqueue entity" X-Git-Tag: firefly_0821_release~3680^2~5^2~3^2~9 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=0e9b1909c3c660060d94a0a8a15c5299de97a4aa;p=firefly-linux-kernel-4.4.55.git HMP: Drop "sched: Fix sleep time double accounting in enqueue entity" This reverts commit f0862cb749c537c32de82912d30110098ddc6cd6. Analysis from Vincent Guittot: With the current implementation, the load average statistics of a sched entity change according to other activity on the CPU even if this activity is done between the running window of the sched entity and have no influence on the running duration of the task. When a task wakes up on the same CPU, we currently update last_runnable_update with the return of __synchronize_entity_decay without updating the runnable_avg_sum and runnable_avg_period accordingly. In fact, we have to sync the load_contrib of the se with the rq's blocked_load_contrib before removing it from the latter (with __synchronize_entity_decay) but we must keep last_runnable_update unchanged for updating runnable_avg_sum/period during the next update_entity_load_avg. Signed-off-by: Mark Brown --- diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index b1e9def76b55..8a4a02740f0a 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -1714,13 +1714,7 @@ static inline void enqueue_entity_load_avg(struct cfs_rq *cfs_rq, } wakeup = 0; } else { - /* - * Task re-woke on same cpu (or else migrate_task_rq_fair() - * would have made count negative); we must be careful to avoid - * double-accounting blocked time after synchronizing decays. - */ - se->avg.last_runnable_update += __synchronize_entity_decay(se) - << 20; + __synchronize_entity_decay(se); } /* migrated tasks did not contribute to our blocked load */