Hi Vincent,
On Thu, Dec 22, 2016 at 05:56:47PM +0100, Vincent Guittot wrote:
On 22 December 2016 at 16:58, Leo Yan leo.yan@linaro.org wrote:
When a new idle CPU executes idle balance, the idle swap thread has not been switched in actually. The current thread is a normal task and this task is going to not occupy the CPU anymore so the CPU is seeking to pull task onto it.
But at this moment rq->h_nr_running still adds accounts for this normal thread; this gives scheduler misunderstanding the CPU has one running task on it and finally adds it into sum running number of schedule group.
Are you sure of the point above ? I'm pretty sure that in the mainline scheduler the task has already been dequeued and cfs->h_nr_running and rq->nr_running have been decreased when newly idle load balance is called so their are null
Ah, you are right :) I reviewed code and verified in trace log I found I misunderstand for the code.
This patch is useless and we should drop it.
Thanks, Leo Yan