aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/random
diff options
context:
space:
mode:
authorDavide Italiano <davide@FreeBSD.org>2013-03-04 16:16:23 +0000
committerDavide Italiano <davide@FreeBSD.org>2013-03-04 16:16:23 +0000
commit36d0b731022d717e2386029a0368f0b0587d5da9 (patch)
tree26e179c27c41e00bc86ca9863c2ab3fe21222d7f /sys/dev/random
parentc38250c9b9cbeeb57955a82cfc8f2a1f45375845 (diff)
downloadsrc-36d0b731022d717e2386029a0368f0b0587d5da9.tar.gz
src-36d0b731022d717e2386029a0368f0b0587d5da9.zip
MFcalloutng (r236314 by mav):
Specify that wakeup rate of 7.5-10Hz is enough for yarrow harvesting thread. Sponsored by: Google Summer of Code 2012, iXsystems inc. Tested by: flo, marius, ian, markj, Fabian Keil
Notes
Notes: svn path=/head/; revision=247799
Diffstat (limited to 'sys/dev/random')
-rw-r--r--sys/dev/random/randomdev_soft.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/dev/random/randomdev_soft.c b/sys/dev/random/randomdev_soft.c
index 420a82a67930..004066ebf316 100644
--- a/sys/dev/random/randomdev_soft.c
+++ b/sys/dev/random/randomdev_soft.c
@@ -242,10 +242,10 @@ random_kthread(void *arg __unused)
local_count = 0;
/* Process until told to stop */
+ mtx_lock_spin(&harvest_mtx);
for (; random_kthread_control >= 0;) {
/* Cycle through all the entropy sources */
- mtx_lock_spin(&harvest_mtx);
for (source = RANDOM_START; source < ENTROPYSOURCE; source++) {
/*
* Drain entropy source records into a thread-local
@@ -270,7 +270,6 @@ random_kthread(void *arg __unused)
emptyfifo.count += local_count;
local_count = 0;
}
- mtx_unlock_spin(&harvest_mtx);
KASSERT(local_count == 0, ("random_kthread: local_count %d",
local_count));
@@ -283,9 +282,11 @@ random_kthread(void *arg __unused)
random_kthread_control = 0;
/* Work done, so don't belabour the issue */
- pause("-", hz / 10);
+ msleep_spin_sbt(&random_kthread_control, &harvest_mtx,
+ "-", SBT_1S / 10, 0, C_PREL(1));
}
+ mtx_unlock_spin(&harvest_mtx);
random_set_wakeup_exit(&random_kthread_control);
/* NOTREACHED */