Module Name:    src
Committed By:   pooka
Date:           Fri Jul 23 19:14:15 UTC 2010

Modified Files:
        src/sys/rump/librump/rumpkern: sleepq.c

Log Message:
If a thread wake up spuriously, re-set l_mutex to make sure it's
still at the original value and not the schedstate one.  This makes
select not miss wakeups in cases where there was a lot of selecting
going on (which is not all that common in a rump kernel).


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/rump/librump/rumpkern/sleepq.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/librump/rumpkern/sleepq.c
diff -u src/sys/rump/librump/rumpkern/sleepq.c:1.7 src/sys/rump/librump/rumpkern/sleepq.c:1.8
--- src/sys/rump/librump/rumpkern/sleepq.c:1.7	Thu Jul 22 21:00:07 2010
+++ src/sys/rump/librump/rumpkern/sleepq.c	Fri Jul 23 19:14:14 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: sleepq.c,v 1.7 2010/07/22 21:00:07 pooka Exp $	*/
+/*	$NetBSD: sleepq.c,v 1.8 2010/07/23 19:14:14 pooka Exp $	*/
 
 /*
  * Copyright (c) 2008 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sleepq.c,v 1.7 2010/07/22 21:00:07 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sleepq.c,v 1.8 2010/07/23 19:14:14 pooka Exp $");
 
 #include <sys/param.h>
 #include <sys/condvar.h>
@@ -85,6 +85,7 @@
 	int biglocks = l->l_biglocks;
 
 	while (l->l_wchan) {
+		l->l_mutex = mp;
 		if ((error=cv_timedwait(&sq_cv, mp, timo)) == EWOULDBLOCK) {
 			TAILQ_REMOVE(l->l_sleepq, l, l_sleepchain);
 			l->l_wchan = NULL;

Reply via email to