From: Holger Dengler <dengler@linux.ibm.com>
To: "Jason A . Donenfeld" <Jason@zx2c4.com>,
Harald Freudenberger <freude@linux.ibm.com>,
Heiko Carstens <hca@linux.ibm.com>,
Vasily Gorbik <gor@linux.ibm.com>,
Alexander Gordeev <agordeev@linux.ibm.com>,
Christian Borntraeger <borntraeger@linux.ibm.com>
Cc: Juergen Christ <jchrist@linux.ibm.com>,
Holger Dengler <dengler@linux.ibm.com>,
linux-crypto@vger.kernel.org, linux-s390@vger.kernel.org
Subject: [PATCH v1 0/1] s390/archrandom: use buffered random data
Date: Tue, 5 Jul 2022 13:27:11 +0200 [thread overview]
Message-ID: <20220705112712.4433-1-dengler@linux.ibm.com> (raw)
The trng instruction on s390 is a long-running instruction and also
condition the raw random data. The result size is always an integer multiple
of 32 bytes. The runtime for the minimum result of 32 bytes is 20-190us
(depending on the machine generation).
To call trng for each arch_get_random_seed_long() call wastes a lot of time.
Doing so in interrupt context as well, can have dramatically impact on
machines with a huge interrupt load, e.g. machines with multiple 10GB
Ethernet cards and high network traffic.
The following patch introduces a buffering for the trng call results, which
reduces the number of calls by factor 4. In interrupt context, the trng call
will be completely avoided, but if buffered random data is available, it
will be used there.
Holger Dengler (1):
s390/arch_random: Buffer true random data
arch/s390/crypto/arch_random.c | 51 +++++++++++++++++++++++++++++-
arch/s390/include/asm/archrandom.h | 17 ++++------
2 files changed, 56 insertions(+), 12 deletions(-)
--
2.36.1
next reply other threads:[~2022-07-05 11:27 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-05 11:27 Holger Dengler [this message]
2022-07-05 11:27 ` [PATCH v1 1/1] s390/arch_random: Buffer true random data Holger Dengler
2022-07-05 13:18 ` Jason A. Donenfeld
2022-07-05 13:42 ` Jason A. Donenfeld
2022-07-05 14:58 ` Holger Dengler
2022-07-05 15:11 ` Jason A. Donenfeld
2022-07-05 16:27 ` Holger Dengler
2022-07-05 16:35 ` Jason A. Donenfeld
2022-07-05 17:47 ` Holger Dengler
2022-07-05 18:19 ` Jason A. Donenfeld
2022-07-05 19:28 ` Holger Dengler
2022-07-06 16:18 ` Harald Freudenberger
2022-07-06 16:26 ` Jason A. Donenfeld
2022-07-06 18:29 ` Christian Borntraeger
2022-07-06 22:34 ` Jason A. Donenfeld
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=20220705112712.4433-1-dengler@linux.ibm.com \
--to=dengler@linux.ibm.com \
--cc=Jason@zx2c4.com \
--cc=agordeev@linux.ibm.com \
--cc=borntraeger@linux.ibm.com \
--cc=freude@linux.ibm.com \
--cc=gor@linux.ibm.com \
--cc=hca@linux.ibm.com \
--cc=jchrist@linux.ibm.com \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-s390@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