linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] sched: fix first task of a task group is attached twice
@ 2016-05-24 13:08 Vincent Guittot
  2016-05-25 15:01 ` [PATCH v2] " Vincent Guittot
  0 siblings, 1 reply; 23+ messages in thread
From: Vincent Guittot @ 2016-05-24 13:08 UTC (permalink / raw)
  To: peterz, mingo, linux-kernel; +Cc: yuyang.du, dietmar.eggemann, Vincent Guittot

The cfs_rq->avg.last_update_time is initialize to 0 with the main effect
that the 1st sched_entity that will be attached, will keep its
last_update_time set to 0 and will attached once again during the
enqueue.
Initialize cfs_rq->avg.last_update_time to current rq's clock

Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
---
 kernel/sched/fair.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 218f8e8..a4e2c10 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -8586,6 +8586,14 @@ void init_tg_cfs_entry(struct task_group *tg, struct cfs_rq *cfs_rq,
 		se->depth = parent->depth + 1;
 	}
 
+	/*
+	 * Set last_update_time to something different from 0 to make
+	 * sure the 1st sched_entity will not be attached twice: once
+	 * when attaching the task to the group and one more time when
+	 * enqueueing the task.
+	 */
+	tg->cfs_rq[cpu]->avg.last_update_time = rq_clock_task(rq_of(cfs_rq));
+
 	se->my_q = cfs_rq;
 	/* guarantee group entities always have weight */
 	update_load_set(&se->load, NICE_0_LOAD);
-- 
1.9.1

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

end of thread, other threads:[~2016-06-16  9:42 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-24 13:08 [PATCH] sched: fix first task of a task group is attached twice Vincent Guittot
2016-05-25 15:01 ` [PATCH v2] " Vincent Guittot
2016-05-25 22:38   ` Yuyang Du
2016-05-26  8:26     ` Vincent Guittot
2016-05-26  0:40       ` Yuyang Du
2016-05-26  8:51         ` Vincent Guittot
2016-05-27 15:48   ` Dietmar Eggemann
2016-05-27 17:16     ` Vincent Guittot
2016-05-27 20:38       ` Dietmar Eggemann
2016-05-30  7:04         ` Vincent Guittot
2016-05-30 15:52           ` [PATCH v3] " Vincent Guittot
2016-05-30 19:48             ` Yuyang Du
2016-05-31  7:28               ` Vincent Guittot
2016-05-31  0:44                 ` Yuyang Du
2016-06-01 15:31             ` Dietmar Eggemann
2016-06-01 15:54               ` Vincent Guittot
2016-06-06 19:32                 ` Dietmar Eggemann
2016-06-07  7:35                   ` Vincent Guittot
2016-06-15 19:19             ` Yuyang Du
2016-06-16  7:12               ` Vincent Guittot
2016-06-15 23:24                 ` Yuyang Du
2016-06-16  9:42                   ` Vincent Guittot
2016-05-30 15:54         ` [PATCH v2] " Vincent Guittot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).