Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/rump/librump/rumpkern No need for a lock around rnd_add_...



details:   https://anonhg.NetBSD.org/src/rev/c25afc289289
branches:  trunk
changeset: 931751:c25afc289289
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Thu Apr 30 03:41:20 2020 +0000

description:
No need for a lock around rnd_add_data any more.

diffstat:

 sys/rump/librump/rumpkern/hyperentropy.c |  10 ++--------
 1 files changed, 2 insertions(+), 8 deletions(-)

diffs (48 lines):

diff -r b99d8f390880 -r c25afc289289 sys/rump/librump/rumpkern/hyperentropy.c
--- a/sys/rump/librump/rumpkern/hyperentropy.c  Thu Apr 30 03:40:52 2020 +0000
+++ b/sys/rump/librump/rumpkern/hyperentropy.c  Thu Apr 30 03:41:20 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: hyperentropy.c,v 1.16 2020/04/30 03:40:53 riastradh Exp $      */
+/*     $NetBSD: hyperentropy.c,v 1.17 2020/04/30 03:41:20 riastradh Exp $      */
 
 /*
  * Copyright (c) 2014 Antti Kantee.  All Rights Reserved.
@@ -26,18 +26,16 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hyperentropy.c,v 1.16 2020/04/30 03:40:53 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hyperentropy.c,v 1.17 2020/04/30 03:41:20 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/kmem.h>
-#include <sys/mutex.h>
 #include <sys/rndsource.h>
 
 #include <rump-sys/kern.h>
 
 #include <rump/rumpuser.h>
 
-static kmutex_t rndsrc_lock;
 static krndsource_t rndsrc;
 
 static void
@@ -56,9 +54,7 @@
                n += MIN(nread, bytes - n);
        }
        if (n) {
-               mutex_enter(&rndsrc_lock);
                rnd_add_data_sync(&rndsrc, rnddata, n, NBBY*n);
-               mutex_exit(&rndsrc_lock);
        }
        kmem_intr_free(rnddata, bytes);
 }
@@ -67,8 +63,6 @@
 rump_hyperentropy_init(void)
 {
 
-       mutex_init(&rndsrc_lock, MUTEX_DEFAULT, IPL_VM);
-
        rndsource_setcb(&rndsrc, &feedrandom, NULL);
        rnd_attach_source(&rndsrc, "rump_hyperent", RND_TYPE_VM,
            RND_FLAG_COLLECT_VALUE|RND_FLAG_HASCB);



Home | Main Index | Thread Index | Old Index