padata: use alignment when calculating the number of worker threads
authorAnthony Yznaga <anthony.yznaga@oracle.com>
Thu, 23 Feb 2023 00:33:12 +0000 (16:33 -0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Tue, 14 Mar 2023 09:06:44 +0000 (17:06 +0800)
commitf84155ca851849e5e8981fddd3945a6cfeea220c
treec7d55b635867808a7efb12f0dac98d8a6906d443
parent1e6204451fb8b14356d8a4c7fd692318edd4a99a
padata: use alignment when calculating the number of worker threads

For multithreaded jobs the computed chunk size is rounded up by the
caller-specified alignment. However, the number of worker threads to
use is computed using the minimum chunk size without taking alignment
into account. A sufficiently large alignment value can result in too
many worker threads being allocated for the job.

Signed-off-by: Anthony Yznaga <anthony.yznaga@oracle.com>
Acked-by: Daniel Jordan <daniel.m.jordan@oracle.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
kernel/padata.c