]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
sched/fair: Limit hrtick work
authorPeter Zijlstra <peterz@infradead.org>
Mon, 1 Sep 2025 20:50:56 +0000 (22:50 +0200)
committerIngo Molnar <mingo@kernel.org>
Sun, 14 Dec 2025 07:25:02 +0000 (08:25 +0100)
The task_tick_fair() function does:

 - update the hierarchical runtimes
 - drive NUMA-balancing
 - update load-balance statistics
 - drive force-idle preemption

All but the very first can be limited to the periodic tick. Let hrtick
only update accounting and drive preemption, not load-balancing and
other bits.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://patch.msgid.link/20250918080205.563385766@infradead.org
kernel/sched/fair.c

index 496a30a418540f6a765206a0205fd8be8f03c4a4..f79951facff4ebc09a91580e5ac8475c50c1351e 100644 (file)
@@ -13332,6 +13332,12 @@ static void task_tick_fair(struct rq *rq, struct task_struct *curr, int queued)
                entity_tick(cfs_rq, se, queued);
        }
 
+       if (queued) {
+               if (!need_resched())
+                       hrtick_start_fair(rq, curr);
+               return;
+       }
+
        if (static_branch_unlikely(&sched_numa_balancing))
                task_tick_numa(rq, curr);