sched/core: Reorganize ttwu_do_wakeup() and ttwu_do_activate()
authorChengming Zhou <zhouchengming@bytedance.com>
Fri, 23 Dec 2022 10:32:57 +0000 (18:32 +0800)
committerIngo Molnar <mingo@kernel.org>
Sat, 7 Jan 2023 09:48:38 +0000 (10:48 +0100)
commit160fb0d83f206b3429fc495864a022110f9e4978
tree6293b8f358c5ebf562d72ee7f6d89bc42d72b3f3
parentefe09385864f3441c71711f91e621992f9423c01
sched/core: Reorganize ttwu_do_wakeup() and ttwu_do_activate()

ttwu_do_activate() is used for a complete wakeup, in which we will
activate_task() and use ttwu_do_wakeup() to mark the task runnable
and perform wakeup-preemption, also call class->task_woken() callback
and update the rq->idle_stamp.

Since ttwu_runnable() is not a complete wakeup, don't need all those
done in ttwu_do_wakeup(), so we can move those to ttwu_do_activate()
to simplify ttwu_do_wakeup(), making it only mark the task runnable
to be reused in ttwu_runnable() and try_to_wake_up().

This patch should not have any functional changes.

Suggested-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Chengming Zhou <zhouchengming@bytedance.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/20221223103257.4962-2-zhouchengming@bytedance.com
kernel/sched/core.c