Re: [PATCH 13/22] x86: smp: move cpumask_weight() out of for-loop in remove_siblinginfo

From: Thomas Gleixner
Date: Wed May 11 2022 - 05:48:24 EST


On Tue, May 10 2022 at 08:47, Yury Norov wrote:

Subject: x86: smp: move cpumask_weight() out of for-loop in remove_siblinginfo

Can you please format this according to

https://www.kernel.org/doc/html/latest/process/maintainer-tip.html#patch-submission-notes

> Because argument of the function is constant inside for_each_cpu()
> loop, the cpumask_weight() does the same work O(NR_CPUS) times, while
> it may be calculated only once.
>
> This patch moves cpumask_weight() out of the loop and replaces it

Ditto.

Thanks,

tglx