All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephan Mueller <smueller@chronox.de>
To: linux-crypto@vger.kernel.org, Haixin Xu <jerryxucs@gmail.com>
Cc: linux-kernel@vger.kernel.org, herbert@gondor.apana.org.au,
	davem@davemloft.net, yifanwucs@gmail.com, tomapufckgml@gmail.com,
	yuantan098@gmail.com, bird@lzu.edu.cn, jerryxucs@gmail.com
Subject: Re: [PATCH 1/1] crypto: jitterentropy - replace long-held spinlock with mutex
Date: Mon, 30 Mar 2026 09:36:36 +0200	[thread overview]
Message-ID: <8044552.18pcnM708K@tauon> (raw)
In-Reply-To: <9a8ef1cbcc68b752a495acf0a23e7095eb0a7796.1774854094.git.jerryxucs@gmail.com>

Am Montag, 30. März 2026, 09:23:46 Mitteleuropäische Sommerzeit schrieb Haixin 
Xu:

Hi Haixin,

> jent_kcapi_random() serializes the shared jitterentropy state, but it
> currently holds a spinlock across the jent_read_entropy() call. That
> path performs expensive jitter collection and SHA3 conditioning, so
> parallel readers can trigger stalls as contending waiters spin for
> the same lock.
> 
> To prevent non-preemptible lock hold, replace rng->jent_lock with a
> mutex so contended readers sleep instead of spinning on a shared lock
> held across expensive entropy generation.

Thank you very much for the report and the patch.

Reviewed-by: Stephan Mueller <smueller@chronox.de>

Ciao
Stephan



  reply	other threads:[~2026-03-30  7:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-30  7:23 [PATCH 0/1] crypto: jitterentropy - fix long-held spinlock contention Haixin Xu
2026-03-30  7:23 ` [PATCH 1/1] crypto: jitterentropy - replace long-held spinlock with mutex Haixin Xu
2026-03-30  7:36   ` Stephan Mueller [this message]
2026-03-30  8:51   ` Herbert Xu
2026-03-30 13:50     ` Haixin Xu
2026-04-12  8:50   ` Herbert Xu

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=8044552.18pcnM708K@tauon \
    --to=smueller@chronox.de \
    --cc=bird@lzu.edu.cn \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=jerryxucs@gmail.com \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tomapufckgml@gmail.com \
    --cc=yifanwucs@gmail.com \
    --cc=yuantan098@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.