Source-Changes-HG archive

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

[src/trunk]: src/sys/kern Correct misunderstanding in previous: a mutex is no...



details:   https://anonhg.NetBSD.org/src/rev/665691348f33
branches:  trunk
changeset: 787368:665691348f33
user:      tls <tls%NetBSD.org@localhost>
date:      Thu Jun 13 01:37:03 2013 +0000

description:
Correct misunderstanding in previous: a mutex is not required to protect
the soft interrupt dispatches.

diffstat:

 sys/kern/kern_rndq.c |  14 ++++----------
 1 files changed, 4 insertions(+), 10 deletions(-)

diffs (50 lines):

diff -r 40b566e5b1fb -r 665691348f33 sys/kern/kern_rndq.c
--- a/sys/kern/kern_rndq.c      Thu Jun 13 00:55:01 2013 +0000
+++ b/sys/kern/kern_rndq.c      Thu Jun 13 01:37:03 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_rndq.c,v 1.11 2013/06/13 00:55:01 tls Exp $       */
+/*     $NetBSD: kern_rndq.c,v 1.12 2013/06/13 01:37:03 tls Exp $       */
 
 /*-
  * Copyright (c) 1997-2013 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_rndq.c,v 1.11 2013/06/13 00:55:01 tls Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_rndq.c,v 1.12 2013/06/13 01:37:03 tls Exp $");
 
 #include <sys/param.h>
 #include <sys/ioctl.h>
@@ -104,11 +104,6 @@
 kmutex_t                       rnd_mtx;
 
 /*
- * This lock protects dispatch of our soft interrupts.
- */
-kmutex_t                       rndsoft_mtx;
-
-/*
  * Entropy sinks: usually other generators waiting to be rekeyed.
  *
  * A sink's callback MUST NOT re-add the sink to the list, or
@@ -207,9 +202,9 @@
 static inline void
 rnd_schedule_softint(void *softint)
 {
-       mutex_spin_enter(&rndsoft_mtx);
+       kpreempt_disable();
        softint_schedule(softint);
-       mutex_spin_exit(&rndsoft_mtx);
+       kpreempt_enable();
 }
 
 /*
@@ -453,7 +448,6 @@
 
        mutex_init(&rnd_mtx, MUTEX_DEFAULT, IPL_VM);
        mutex_init(&rndsink_mtx, MUTEX_DEFAULT, IPL_VM);
-       mutex_init(&rndsoft_mtx, MUTEX_DEFAULT, IPL_VM);
 
        /*
         * take a counter early, hoping that there's some variance in



Home | Main Index | Thread Index | Old Index