summaryrefslogtreecommitdiff
path: root/kernel/fail_function.c
diff options
context:
space:
mode:
authorShubhang Kaushik (Ampere) <sh@gentwo.org>2026-09-17 16:06:59 -0700
committerPeter Zijlstra <peterz@infradead.org>2026-09-25 12:45:57 +0200
commitc72945693b90423f1b46ac2dbc8749c2b7804fc8 (patch)
tree07399f21ac2b79f5b5869cc726f29d8a8d66b344 /kernel/fail_function.c
parenta9b3c7570564de40acb0998ab85c89d546b2122f (diff)
downloadlinux-next-c72945693b90423f1b46ac2dbc8749c2b7804fc8.tar.gz
linux-next-c72945693b90423f1b46ac2dbc8749c2b7804fc8.zip
sched: Restart fair hrtick after same-task repicks
Fair hrticks are one-shot timers. A same-task repick after hrtick expiry skips set_next_task_fair() and leaves no hrtick armed for the next fair preemption point: hrtick() -> task_tick_fair(..., queued=1) -> entity_tick() -> resched_curr() -> schedule() -> pick_task_fair() selects current -> put_prev_set_next_task(rq, prev, next) -> next == prev -> return Introduce SNT_REPICK for the next == prev path: put_prev_set_next_task(rq, prev, next) -> next == prev -> next->sched_class->set_next_task(rq, next, SNT_REPICK) -> set_next_task_fair() -> hrtick_start_fair() set_next_task_fair() skips task-transition work for SNT_REPICK and restarts the fair hrtick. hrtick_start() records the delay during schedule(), and hrtick_schedule_exit() rearms the timer. Do not restart the SCHED_DEADLINE hrtick for SNT_REPICK. Same-task repicks skip put_prev_task() for both fair and SCHED_DEADLINE, but pick_task_fair() refreshes the selected fair entity before selecting it again. hrtick_start_fair() reads that refreshed entity, including with group scheduling. The SCHED_DEADLINE picker has no corresponding current-runtime update. Restarting its hrtick on SNT_REPICK could therefore use stale dl_se->runtime and delay the next runtime enforcement point. Suggested-by: Peter Zijlstra (Intel) <peterz@infradead.org> Signed-off-by: Shubhang Kaushik (Ampere) <sh@gentwo.org> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Reviewed-by: Zhan Xusheng <zhanxusheng@xiaomi.com> Link: https://patch.msgid.link/20260917-sched-fair-hrtick-restart-v4-1-4dd1414da81a@gentwo.org
Diffstat (limited to 'kernel/fail_function.c')
0 files changed, 0 insertions, 0 deletions