Re: [PATCH 2/8] sched/fair: Limit hrtick work

From: K Prateek Nayak

Date: Fri Sep 19 2025 - 10:59:20 EST


Hello Peter,

On 9/18/2025 1:22 PM, Peter Zijlstra wrote:
> @@ -13119,6 +13119,12 @@ static void task_tick_fair(struct rq *rq
> entity_tick(cfs_rq, se, queued);
> }
>
> + if (queued) {
> + if (!need_resched())
> + hrtick_start_fair(rq, curr);

Do we need a hrtick_start_fair() here? Queued tick will always do a
resched_curr_lazy() - if another HRTICK fires before the next tick,
all it'll do is resched_curr_lazy() again and the next opportunity to
resched is either exit to userspace or the periodic tick firing and
promoting that LAZY to a full NEED_RESCHED.

The early return does makes sense.

> + return;
> + }
> +
> if (static_branch_unlikely(&sched_numa_balancing))
> task_tick_numa(rq, curr);
>

--
Thanks and Regards,
Prateek