Re: [PATCH] crypto: iaa - Fix race condition when probing IAA devices
From: Herbert Xu
Date: Thu Jun 12 2025 - 01:38:50 EST
On Wed, Jun 11, 2025 at 02:17:49PM -0700, Vinicius Costa Gomes wrote:
>
> >From what I could gather, the idea of the per-cpu workqueue table ("map"
> really) is more to "spread" the workqueues to different CPUS than to
> reduce contention.
>
> If the question is more about the choice of using per-cpu variables, I
> can look for alternatives.
Prior to your patch, the compress/decompress paths simply did a
lockless per-cpu lookup to find the wq. Now you're taking a global
spinlock to do the same lookup.
That makes no sense. Either it should be redesigned to not use
a spinlock, or the per-cpu data structure should be removed since
it serves no purpose as you're always taking a global spinlock.
Cheers,
--
Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt