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 If a thread wake up spuriously, re...



details:   https://anonhg.NetBSD.org/src/rev/1151a51a37b6
branches:  trunk
changeset: 756559:1151a51a37b6
user:      pooka <pooka%NetBSD.org@localhost>
date:      Fri Jul 23 19:14:14 2010 +0000

description:
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).

diffstat:

 sys/rump/librump/rumpkern/sleepq.c |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (26 lines):

diff -r e6f4872b43e2 -r 1151a51a37b6 sys/rump/librump/rumpkern/sleepq.c
--- a/sys/rump/librump/rumpkern/sleepq.c        Fri Jul 23 13:54:21 2010 +0000
+++ b/sys/rump/librump/rumpkern/sleepq.c        Fri Jul 23 19:14:14 2010 +0000
@@ -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;



Home | Main Index | Thread Index | Old Index