Thu Jun 13 01:37:03 2013 UTC ()
Correct misunderstanding in previous: a mutex is not required to protect
the soft interrupt dispatches.


(tls)
diff -r1.11 -r1.12 src/sys/kern/kern_rndq.c

cvs diff -r1.11 -r1.12 src/sys/kern/Attic/kern_rndq.c (expand / switch to context diff)
--- src/sys/kern/Attic/kern_rndq.c 2013/06/13 00:55:01 1.11
+++ src/sys/kern/Attic/kern_rndq.c 2013/06/13 01:37:03 1.12
@@ -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