[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZsBNZXfVZbtZnb2Y@gondor.apana.org.au>
Date: Sat, 17 Aug 2024 15:12:37 +0800
From: Herbert Xu <herbert@...dor.apana.org.au>
To: Waiman Long <longman@...hat.com>
Cc: steffen.klassert@...unet.com, daniel.m.jordan@...cle.com,
akpm@...ux-foundation.org, linux-crypto@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] padata: Fix possible divide-by-0 panic in
padata_mt_helper()
On Mon, Aug 12, 2024 at 10:04:07AM -0400, Waiman Long wrote:
>
> Anyway, using DIV_ROUND_UP() is a slight change in behavior as chunk_size
> will be increased by 1 in most cases. I am a bit hesitant to make this
> change without looking into more detail about the rationale behind the
> current code.
I don't think it matters much. Just look at the two lines after
the division, they're both rounding the value up. So clearly this
is expected to handle the case where work gets bunched up into the
first N CPUs, potentially leaving some CPUs unused.
But Daniel wrote the code so he can have the last say of whether
we should round up after the division or after the other two ops.
Daniel?
Cheers,
--
Email: Herbert Xu <herbert@...dor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
Powered by blists - more mailing lists