Re: [PATCH] timers: Exclude isolated cpus from timer migation

Frederic Weisbecker
2025-04-11T11:31:10Z

Le Fri, Apr 11, 2025 at 09:08:35AM +0200, Gabriele Monaco a écrit :
> Mmh, my patch is in fact allowing isolated cores to still migrate
> everything if they go offline.

Sure that doesn't change.

>
> However I don't think housekeeping CPUs can execute remote timers on
> isolated ones.

I'm confused, a CPU can't execute something on another CPU (except with
an IPI). But:

Before your patch, a housekeeping or isolated CPU can pull timers from
any other CPU and execute them on its behalf.

After your patch, a housekeeping CPU can only pull timers from other
housekeeping CPUs. And isolated CPUs each execute their own global timers.

> That is not a problem for offline CPUs (they won't start
> anything and do the migration while offlining is enough), but we should
> allow it here.
> I may be missing something, but isn't it what [1] is doing?

That's only something that avoids pulling timers from offlining CPUs.

The real migration happens at timers_dead_cpu(), which is called
directly by cpu_down() / cpu_up() callers context. And timers are
migrated to the current CPU, which is fine if cpu_down()/cpu_up()
are being called from a task that is affine to housekeeping.

Thanks.

>
> Thanks,
> Gabriele
>
> [1] -
> https://elixir.bootlin.com/linux/v6.13.7/source/kernel/time/timer_migration.c#L976
>

--
Frederic Weisbecker
SUSE Labs