]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
sched: Have try_to_wake_up() handle return-migration for PROXY_WAKING case
authorJohn Stultz <jstultz@google.com>
Tue, 12 May 2026 02:56:15 +0000 (02:56 +0000)
committerPeter Zijlstra <peterz@infradead.org>
Tue, 2 Jun 2026 10:26:07 +0000 (12:26 +0200)
commitf13beb010e4ab0735c9e46802cbcc820a8bd6467
tree6e77721fdd8ffbc22a66e0a2c8ab912fc6da19e7
parentf0c1ecde6447079505f1d4557d30401136218ae0
sched: Have try_to_wake_up() handle return-migration for PROXY_WAKING case

This patch adds logic so try_to_wake_up() will notice if we are
waking a task where blocked_on == PROXY_WAKING, and if necessary
dequeue the task so the wakeup will naturally return-migrate the
donor task back to a cpu it can run on.

This helps performance as we do the dequeue and wakeup under the
locks normally taken in the try_to_wake_up() and avoids having
to do proxy_force_return() from __schedule(), which has to
re-take similar locks and then force a pick again loop.

This was split out from the larger proxy patch, and
significantly reworked.

Credits for the original patch go to:
  Peter Zijlstra (Intel) <peterz@infradead.org>
  Juri Lelli <juri.lelli@redhat.com>
  Valentin Schneider <valentin.schneider@arm.com>
  Connor O'Brien <connoro@google.com>

Signed-off-by: John Stultz <jstultz@google.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://patch.msgid.link/20260512025635.2840817-6-jstultz@google.com
include/linux/sched.h
kernel/sched/core.c