Linux cryptographic layer development
 help / color / mirror / Atom feed
From: Vinicius Costa Gomes <vinicius.gomes@intel.com>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Kristen Accardi <kristen.c.accardi@intel.com>,
	"David S. Miller" <davem@davemloft.net>,
	linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/4] crypto: iaa - use RCU per-package WQ tables
Date: Thu, 12 Nov 2026 14:34:46 -0800	[thread overview]
Message-ID: <87pkw9u1a1.fsf@intel.com> (raw)
In-Reply-To: <avRHIuISSNUxfAU4@gondor.apana.org.au>

Hi,

Herbert Xu <herbert@gondor.apana.org.au> writes:

> On Mon, Oct 19, 2026 at 04:06:22PM -0700, Vinicius Costa Gomes wrote:
>> rebalance_wq_table() gives CPU n all the WQs of IAA device
>> n / cpus_per_iaa. The flat index ignores package boundaries, so a CPU
>> can be paired with a device on another package, and each CPU sends all
>> its requests to one device while the other devices of its package stay
>> idle. The table is also rebuilt in place, so a request issued during a
>> probe or remove can read a NULL WQ and fail with -ENODEV.
>> 
>> Replace it with one table per package, holding the WQs of every IAA
>> device on that package, and have each CPU round-robin over its package's
>> table. Rebalance builds the whole set of tables and publishes it with
>> rcu_replace_pointer(). The submit paths look the WQ up, and take their
>> reference on it, inside an RCU read-side section.
>> 
>> - A package without IAA devices gets a copy of another package's table,
>>   so the lookup needs no fallback.
>> - Every table has room for all the WQs, a few pointers more than it
>>   needs, so they can be sized without counting per package.
>> - If a rebalance fails, the current tables are kept. On removal they
>>   are cleared instead, because they still hold the removed WQ. Removal
>>   then waits for a grace period before returning, because the idxd_wq
>>   can be freed after that.
>> 
>> Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
>> ---
>>  drivers/crypto/intel/iaa/iaa_crypto.h      |   7 -
>>  drivers/crypto/intel/iaa/iaa_crypto_main.c | 346 ++++++++++-------------------
>>  2 files changed, 117 insertions(+), 236 deletions(-)
>
> Please respond to this comment:
>
> https://sashiko.dev/#/patchset/20261019-iaa-crypto-wq-tables-v1-0-fab67b2a1538%40intel.com
>

Weird that I haven't received any notification about these comments.

Anyway, as I moved some code around, sashiko considers it a "new" issue,
but from a quick look, it's a pre-existing one. Doesn't seem too hard to
fix, will include the fix on v2.


Cheers,
-- 
Vinicius

  reply	other threads:[~2026-11-12 22:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-19 23:06 [PATCH 0/4] crypto: iaa - rework the WQ selection tables Vinicius Costa Gomes
2026-10-19 23:06 ` [PATCH 1/4] crypto: iaa - carry the iaa_wq in the request Vinicius Costa Gomes
2026-10-19 23:06 ` [PATCH 2/4] crypto: iaa - take the WQ from the request in the submit helpers Vinicius Costa Gomes
2026-10-19 23:06 ` [PATCH 3/4] crypto: iaa - use RCU per-package WQ tables Vinicius Costa Gomes
2026-11-11 10:44   ` Herbert Xu
2026-11-12 22:34     ` Vinicius Costa Gomes [this message]
2026-10-19 23:06 ` [PATCH 4/4] crypto: iaa - keep each CPU on one WQ for decompression Vinicius Costa Gomes

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87pkw9u1a1.fsf@intel.com \
    --to=vinicius.gomes@intel.com \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=kristen.c.accardi@intel.com \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox