Re: [RFC PATCH RESEND 02/10] scbed/fair: Remove duplicate check for busiest_cpu in active_load_balance_cpu_stop()

From: Kayra Cizmeci

Date: Thu Sep 10 2026 - 07:51:51 EST


Hello Xin,

> The check for cpu_active(busiest_cpu) already ensures that busiest_cpu has
> not gone down. An additional check for busiest_cpu != smp_processor_id()
> is redundant. After this modification, busiest_cpu will no longer be bound
> to smp_processor_id(), allowing the active_load_balance_cpu_stop function
> to accommodate more scenarios, such as preempt active balancing feature
> that will be addressed in later patches.

The code is complicated and I usually not come near here.

But how did you reach the conclusion of smp_processor_id() check is redundant?

The cpu_active(busiest_cpu) just looks at the CPU mask of the given CPU or busiest in our case.
But smp_processor_id() doesn't performs the same checks. And even if it's doing the same checks,
how are you ensuring that it looks to the busiest CPU without even getting any parameters?

For your conclusion to be right, the busiest CPU must be the CPU that smp_processor_id() looks
and the cpu_active(busiest_cpu), smp_processor_id() needs to behave the same.

And please add some details to the commit message why smp_processor_id() is redundant rather than
skipping what smp_processor_id() does in any case.

Please notify me if I'm wrong :_:

Thanks,
Kayra :-)