Source-Changes-HG archive

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

[src/trunk]: src/sys/kern KASSERT we don't kpause indefinitely without interr...



details:   https://anonhg.NetBSD.org/src/rev/0a5162f5c3a9
branches:  trunk
changeset: 758326:0a5162f5c3a9
user:      pooka <pooka%NetBSD.org@localhost>
date:      Tue Nov 02 15:17:37 2010 +0000

description:
KASSERT we don't kpause indefinitely without interruptability.

XXX: using timo == 0 to mean "sleep as long as you like, and forever
if you're really tired" is not the smartest interface considering
the the hz/n idiom used to specify timo.  This leads to unwanted
behaviour when hz gets below some impossible-to-know limit.  With
a usec2ticks() routine it at least be a little more tolerable.

diffstat:

 sys/kern/kern_synch.c |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (27 lines):

diff -r fd21169b3c32 -r 0a5162f5c3a9 sys/kern/kern_synch.c
--- a/sys/kern/kern_synch.c     Tue Nov 02 15:09:52 2010 +0000
+++ b/sys/kern/kern_synch.c     Tue Nov 02 15:17:37 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_synch.c,v 1.283 2010/04/30 10:02:00 martin Exp $  */
+/*     $NetBSD: kern_synch.c,v 1.284 2010/11/02 15:17:37 pooka Exp $   */
 
 /*-
  * Copyright (c) 1999, 2000, 2004, 2006, 2007, 2008, 2009
@@ -69,7 +69,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_synch.c,v 1.283 2010/04/30 10:02:00 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_synch.c,v 1.284 2010/11/02 15:17:37 pooka Exp $");
 
 #include "opt_kstack.h"
 #include "opt_perfctrs.h"
@@ -256,6 +256,8 @@
        sleepq_t *sq;
        int error;
 
+       KASSERT(!(timo == 0 && intr == false));
+
        if (sleepq_dontsleep(l))
                return sleepq_abort(NULL, 0);
 



Home | Main Index | Thread Index | Old Index