Re: [PATCH] sched/fair: Don't let task_tick_cache() IPI dyntick CPUs

From: Valentin Schneider

Date: Fri Nov 20 2026 - 06:03:02 EST


On 20/11/26 09:34, Peter Zijlstra wrote:
> On Thu, Nov 19, 2026 at 09:38:25PM +0100, Valentin Schneider wrote:
>> @@ -1925,6 +1925,13 @@ static void task_tick_cache(struct rq *rq, struct task_struct *p)
>> !grp->pcpu_sched)
>> return;
>>
>> + /*
>> + * We got here from a sched_tick_remote(), meaning @p is making use of
>> + * NOHZ_FULL. Don't disturb it with a task_work() IPI.
>> + */
>> + if (cpu_of(rq) != smp_processor_id())
>> + return;
>> +
>> epoch = rq->cpu_epoch;
>> /* avoid moving backwards */
>> if (time_after_eq(grp->epoch, epoch))
>
>
> Its early, and I definitely need more wake-up juice, but how is
> task_tick_numa() different here?
>

It shouldn't be too different, I just can't get it to trigger on my QEMU
setup; I'm done running stuff on the machine I caught this on so I can
start digging there.

> @@ -15401,15 +15404,20 @@ static void task_tick_fair(struct rq *rq, struct task_struct *curr, int hrtick)
> if (hrtick)
> return;
>
> - if (static_branch_unlikely(&sched_numa_balancing))
> - task_tick_numa(rq, curr);
> + task_tick_core(rq, curr);
>
> + /*
> + * If there is no root domain; there is no balancing, and none of this
> + * matters.
> + */
> + if (!rq->rd)
> + return;
> +

What if the setup involves a separate root domain where all the CPUs are in
dynticks mode?

Methinks the signal we want is:

is that task on a NOHZ_FULL CPU with the tick disabled?

If so then we shouldn't do anything about it. Let the other CPUs in its LLC
/ RD run some balancing. If they're all dynticks, well then there is
nothing to do is there?

And that should also apply to the NUMA stuff like you pointed out.

> + task_tick_numa(rq, curr);
> task_tick_cache(rq, curr);
>
> update_misfit_status(curr, rq);
> check_update_overutilized_status(task_rq(curr));
> -
> - task_tick_core(rq, curr);
> }
>
> /*