• Joonwoo Park's avatar
    sched/core: Fix incorrect wait time and wait count statistics · 3ea94de1
    Joonwoo Park authored
    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: default avatarJoonwoo Park <joonwoop@codeaurora.org>
    Signed-off-by: default avatarPeter 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.orgSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
    3ea94de1
fair.c 219 KB