sched: psi: pass enqueue/dequeue flags to psi callbacks directly
authorJohannes Weiner <hannes@cmpxchg.org>
Mon, 14 Oct 2024 14:43:58 +0000 (10:43 -0400)
committerPeter Zijlstra <peterz@infradead.org>
Sat, 26 Oct 2024 07:28:38 +0000 (09:28 +0200)
commit1a6151017ee5a30cb2d959f110ab18fc49646467
treeab5da0a6713ba7af603e1eae7bd7c9860f65bb2f
parent23f1178ad706a1aa69ac3dfaa6559f1fb876c14e
sched: psi: pass enqueue/dequeue flags to psi callbacks directly

What psi needs to do on each enqueue and dequeue has gotten more
subtle, and the generic sched code trying to distill this into a bool
for the callbacks is awkward.

Pass the flags directly and let psi parse them. For that to work, the
#include "stats.h" (which has the psi callback implementations) needs
to be below the flag definitions in "sched.h". Move that section
further down, next to some of the other accounting stuff.

This also puts the ENQUEUE_SAVE/RESTORE branch behind the psi jump
label, slightly reducing overhead when PSI=y but runtime disabled.

Suggested-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20241014144358.GB1021@cmpxchg.org
kernel/sched/core.c
kernel/sched/sched.h
kernel/sched/stats.h