diff options
| author | Peter Zijlstra <peterz@infradead.org> | 2024-05-23 12:25:32 +0200 |
|---|---|---|
| committer | Peter Zijlstra <peterz@infradead.org> | 2024-08-17 11:06:44 +0200 |
| commit | 152e11f6df293e816a6a37c69757033cdc72667d (patch) | |
| tree | 683c09b57827c21d70d2eb56cfee30c368a8ec66 /kernel/sched/features.h | |
| parent | e1459a50ba31831efdfc35278023d959e4ba775b (diff) | |
sched/fair: Implement delayed dequeue
Extend / fix 86bfbb7ce4f6 ("sched/fair: Add lag based placement") by
noting that lag is fundamentally a temporal measure. It should not be
carried around indefinitely.
OTOH it should also not be instantly discarded, doing so will allow a
task to game the system by purposefully (micro) sleeping at the end of
its time quantum.
Since lag is intimately tied to the virtual time base, a wall-time
based decay is also insufficient, notably competition is required for
any of this to make sense.
Instead, delay the dequeue and keep the 'tasks' on the runqueue,
competing until they are eligible.
Strictly speaking, we only care about keeping them until the 0-lag
point, but that is a difficult proposition, instead carry them around
until they get picked again, and dequeue them at that point.
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Valentin Schneider <vschneid@redhat.com>
Tested-by: Valentin Schneider <vschneid@redhat.com>
Link: https://lkml.kernel.org/r/20240727105030.226163742@infradead.org
Diffstat (limited to 'kernel/sched/features.h')
| -rw-r--r-- | kernel/sched/features.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/kernel/sched/features.h b/kernel/sched/features.h index 97fb2d492089..1feaa7bbc278 100644 --- a/kernel/sched/features.h +++ b/kernel/sched/features.h @@ -29,6 +29,15 @@ SCHED_FEAT(NEXT_BUDDY, false) SCHED_FEAT(CACHE_HOT_BUDDY, true) /* + * Delay dequeueing tasks until they get selected or woken. + * + * By delaying the dequeue for non-eligible tasks, they remain in the + * competition and can burn off their negative lag. When they get selected + * they'll have positive lag by definition. + */ +SCHED_FEAT(DELAY_DEQUEUE, true) + +/* * Allow wakeup-time preemption of the current task: */ SCHED_FEAT(WAKEUP_PREEMPTION, true) |