Skip to content

Optimise try_to_wake_up() when wakee is descheduling

Mel Gorman lkml 1 version Applied

Status from this message: I've applied these two patches to tip:sched/core:

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 2 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/2sched: Optimize ttwu() spinning on p->on_cpukernel/sched/core.c+31 -210 replies
2/2sched: Offload wakee task activation if it the wakee is deschedulingkernel/sched/core.c kernel/sched/sched.h+36 -81 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] Optimise try_to_wake_up() when wakee is descheduling

The following two patches optimise try_to_wake_up() when the wakee is descheduling. In a vanilla kernel, there can be excessive time spent spinning on p->on_rq. This is fine if it's a strictly synchronous wakeup and the waker is going to sleep but in other cases, the waker spins until it can do work that can be deferred to the wakee.

The first patch frontloads work that can be done before p->on_rq is checked. If it's a wakeup on a CPU that does not share cache then the wakelist is used instead of spinning. The second patch goes a little further and uses the wakelist if the wakee is descheduling and is the only task running on the target CPU.

The performance impact is documented in the changelog of the second patch.

 kernel/sched/core.c  | 81 ++++++++++++++++++++++++++++++++------------
 kernel/sched/sched.h |  3 +-
 2 files changed, 61 insertions(+), 23 deletions(-)
Signature · 1 line
2.26.1