All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sched: fix sched_entity avg statistics update
@ 2014-01-21 16:12 Vincent Guittot
  2014-01-21 18:38 ` bsegall
  2014-01-22 10:10 ` [PATCH] sched: fix sched_entity avg statistics update Chris Redpath
  0 siblings, 2 replies; 11+ messages in thread
From: Vincent Guittot @ 2014-01-21 16:12 UTC (permalink / raw)
  To: peterz, linux-kernel; +Cc: mingo, pjt, bsegall, linaro-kernel, 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: Vincent Guittot <vincent.guittot@linaro.org>
---
 kernel/sched/fair.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index e64b079..5b0ef90 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -2370,8 +2370,7 @@ static inline void enqueue_entity_load_avg(struct cfs_rq *cfs_rq,
 		 * 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 */
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2014-01-23 16:47 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-21 16:12 [PATCH] sched: fix sched_entity avg statistics update Vincent Guittot
2014-01-21 18:38 ` bsegall
2014-01-21 20:06   ` Vincent Guittot
     [not found]   ` <CAKfTPtDEKnM+er0NLxCKN4gK_KP3hnzPd13k7qqYtyWKCgdP4w@mail.gmail.com>
2014-01-21 20:31     ` Paul Turner
2014-01-21 20:45       ` Peter Zijlstra
2014-01-22  7:45       ` [PATCH] Revert "sched: Fix sleep time double accounting in enqueue entity" Vincent Guittot
2014-01-22  7:50         ` Vincent Guittot
2014-01-22 17:53         ` bsegall
2014-01-22 19:54           ` Paul Turner
2014-01-23 16:46         ` [tip:sched/urgent] " tip-bot for Vincent Guittot
2014-01-22 10:10 ` [PATCH] sched: fix sched_entity avg statistics update Chris Redpath

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.