Re: [PATCH] crypto: iaa - Use cpumask_weight() when rebalancing

From: Herbert Xu
Date: Fri Apr 12 2024 - 03:32:33 EST


On Fri, Apr 05, 2024 at 01:57:30PM -0500, Tom Zanussi wrote:
> If some cpus are offlined, or if the node mask is smaller than
> expected, the 'nonexistent cpu' warning in rebalance_wq_table() may be
> erroneously triggered.
>
> Use cpumask_weight() to make sure we only iterate over the exact
> number of cpus in the mask.
>
> Also use num_possible_cpus() instead of num_online_cpus() to make sure
> all slots in the wq table are initialized.
>
> Signed-off-by: Tom Zanussi <tom.zanussi@xxxxxxxxxxxxxxx>
> ---
> drivers/crypto/intel/iaa/iaa_crypto_main.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)

Patch applied. Thanks.
--
Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt