Re: [RFC PATCH v2 1/2] sched: Document WF_SYNC wakeup placement semantics
From: Shrikanth Hegde
Date: Fri Sep 18 2026 - 10:15:03 EST
Hi Peter,
On 9/18/26 5:03 PM, Peter Zijlstra wrote:
On Thu, Sep 17, 2026 at 01:43:24PM -0700, Shubhang Kaushik (Ampere) wrote:
WF_SYNC is supplied by callers that expect the waker to schedule away
soon. The fair scheduler can use it as a placement and preemption hint,
but its semantics are not documented.
Document the stable fair-class WF_SYNC semantics. WF_SYNC is advisory:
it can influence placement and preemption, but does not guarantee CPU
locality, avoidance of migration, or immediate wakee preemption.
This documents existing behavior only. It does not establish a new
WF_SYNC placement policy.
Signed-off-by: Shubhang Kaushik (Ampere) <sh@xxxxxxxxxx>
*groan*, why not just a comment that goes with WF_SYNC? All this
documentation stuff is a dumping ground for bitrot.
I suggested to document this since there were atleast 4 proposals around
modifications of WF_SYNC and it was very confusing.
Did you get a chance to look at below abuse of the sync api?
https://lore.kernel.org/all/20260714013940.4068189-4-srikar@xxxxxxxxxxxxx/
For that reason, I think either document/comment around what's the expectation
will help. Either scheduler need to account of all usecases of even when users of
SYNC misbehave or such callsites must be fixed and SYNC behavior can be kept minimum.