sched/core: Fix incorrect wait time and wait count statistics
authorJoonwoo Park <joonwoop@codeaurora.org>
Fri, 13 Nov 2015 03:38:54 +0000 (19:38 -0800)
committerIngo Molnar <mingo@kernel.org>
Mon, 23 Nov 2015 08:48:17 +0000 (09:48 +0100)
commit3ea94de15ce9f3a217f6d0a7e9e0f48388902bb7
treec7d82c79fabbbd8e630c9831f74d5aba8e1cbb57
parent51170840fe91dfca10fd533b303ea39b2524782a
sched/core: Fix incorrect wait time and wait count statistics

At present scheduler resets task's wait start timestamp when the task
migrates to another rq.  This misleads scheduler itself into reporting
less wait time than actual by omitting time spent for waiting prior to
migration and also more wait count than actual by counting migration as
wait end event which can be seen by trace or /proc/<pid>/sched with
CONFIG_SCHEDSTATS=y.

Carry forward migrating task's wait time prior to migration and
don't count migration as a wait end event to fix such statistics error.

In order to determine whether task is migrating mark task->on_rq with
TASK_ON_RQ_MIGRATING while dequeuing and enqueuing due to migration.

Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: ohaugan@codeaurora.org
Link: http://lkml.kernel.org/r/20151113033854.GA4247@codeaurora.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
kernel/sched/core.c
kernel/sched/fair.c