Re: [PATCH v6 1/4] sched/fair: Fix attaching task sched avgs twice when switching to fair or changing task group

From: Yuyang Du
Date: Wed Jun 15 2016 - 04:15:18 EST


On Wed, Jun 15, 2016 at 09:46:53AM +0200, Vincent Guittot wrote:
> I still have concerned with this change of the behavior that attaches
> the task only when it is enqueued. The load avg of the task will not
> be decayed between the time we move it into its new group until its
> enqueue. With this change, a task's load can stay high whereas it has
> slept for the last couple of seconds.

The task will be updated when it is moved in the detach, so if it stays
high, it is highly expected to be enqueued soon. But if the task is never
enqueued, we don't bother the new gruop cfs_rq.

So this is not perfect, and nothing is perfect, but a simple solution.