diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 07cc17141afe..6b42f916a36e 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -3919,7 +3919,7 @@ static int ttwu_runnable(struct task_struct *p, int wake_flags) * When on_rq && !on_cpu the task is preempted, see if * it should preempt the task that is current now. */ - wakeup_preempt(rq, p, wake_flags); + wakeup_preempt(rq, p, wake_flags | WF_TTWU_RQ); } ttwu_do_wakeup(p); return 1; diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index b98084e1f5b0..a0f391fc4294 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -2545,6 +2545,7 @@ static inline int task_on_rq_migrating(struct task_struct *p) #define WF_MIGRATED 0x20 /* Internal use, task got migrated */ #define WF_CURRENT_CPU 0x40 /* Prefer to move the wakee to the current CPU. */ #define WF_RQ_SELECTED 0x80 /* ->select_task_rq() was called */ +#define WF_TTWU_RQ 0x100 /* Wakeup completed through ttwu_runnable() */ static_assert(WF_EXEC == SD_BALANCE_EXEC); static_assert(WF_FORK == SD_BALANCE_FORK);