Skip to content

s390/archrandom: use buffered random data

Holger Dengler linux-crypto linux-s390 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest1 patch 13 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/1s390/arch_random: Buffer true random dataarch/s390/crypto/arch_random.c arch/s390/include/asm/archrandom.h+56 -1213 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH v1 0/1] s390/archrandom: use buffered random data

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(-)
Signature · 1 line
2.36.1