sched/core: Avoid double calling update_rq_clock() in __balance_push_cpu_stop()
authorHao Jia <jiahao.os@bytedance.com>
Tue, 13 Jun 2023 08:20:10 +0000 (16:20 +0800)
committerPeter Zijlstra <peterz@infradead.org>
Fri, 16 Jun 2023 20:08:12 +0000 (22:08 +0200)
commit96500560f0c73c71bca1b27536c6254fa0e8ce37
treeed3e7df0aa513bc5a2395ce2680bbe444e09b2b6
parentcab3ecaed5cdcc9c36a96874b4c45056a46ece45
sched/core: Avoid double calling update_rq_clock() in __balance_push_cpu_stop()

There is a double update_rq_clock() invocation:

  __balance_push_cpu_stop()
    update_rq_clock()
    __migrate_task()
      update_rq_clock()

Sadly select_fallback_rq() also needs update_rq_clock() for
__do_set_cpus_allowed(), it is not possible to remove the update from
__balance_push_cpu_stop(). So remove it from __migrate_task() and
ensure all callers of this function call update_rq_clock() prior to
calling it.

Signed-off-by: Hao Jia <jiahao.os@bytedance.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Vincent Guittot <vincent.guittot@linaro.org>
Link: https://lkml.kernel.org/r/20230613082012.49615-3-jiahao.os@bytedance.com
kernel/sched/core.c