Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 Nov 2021 18:27:35 GMT
From:      Colin Percival <cperciva@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 1580afcd6eaf - main - randomdev: Remove 100 ms sleep from write routine
Message-ID:  <202111161827.1AGIRZkW078540@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by cperciva:

URL: https://cgit.FreeBSD.org/src/commit/?id=1580afcd6eaf803192f014f3658036cbd49a6e3c

commit 1580afcd6eaf803192f014f3658036cbd49a6e3c
Author:     Colin Percival <cperciva@FreeBSD.org>
AuthorDate: 2021-11-13 16:38:09 +0000
Commit:     Colin Percival <cperciva@FreeBSD.org>
CommitDate: 2021-11-16 18:27:27 +0000

    randomdev: Remove 100 ms sleep from write routine
    
    This was introduced in 2014 along with the comment (which has since
    been deleted):
            /* Introduce an annoying delay to stop swamping */
    
    Modern cryptographic random number generators can ingest arbitrarily
    large amounts of non-random (or even maliciously selected) input
    without losing their security.
    
    Depending on the number of "boot entropy files" present on the system,
    this can speed up the boot process by up to 1 second.
    
    Reviewed by:    cem
    MFC ater:       1 week
    Sponsored by:   https://www.patreon.com/cperciva
    Differential Revision:  https://reviews.freebsd.org/D32984
---
 sys/dev/random/randomdev.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/sys/dev/random/randomdev.c b/sys/dev/random/randomdev.c
index 4b032cd3feb9..02b92d226417 100644
--- a/sys/dev/random/randomdev.c
+++ b/sys/dev/random/randomdev.c
@@ -340,7 +340,6 @@ randomdev_write(struct cdev *dev __unused, struct uio *uio, int flags __unused)
 		if (error)
 			break;
 		randomdev_accumulate(random_buf, c);
-		tsleep(p_random_alg_context, 0, "randwr", hz/10);
 	}
 	if (nbytes != uio->uio_resid && (error == ERESTART || error == EINTR))
 		/* Partial write, not error. */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202111161827.1AGIRZkW078540>