From 0de1b73a11bb67bdef9a5856d252d838e79ddbc3 Mon Sep 17 00:00:00 2001 From: pooka Date: Tue, 11 Jan 2011 10:49:20 +0000 Subject: [PATCH] KASSERT we don't return back to userspace with the kernel lock held. --- sys/rump/librump/rumpkern/scheduler.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/sys/rump/librump/rumpkern/scheduler.c b/sys/rump/librump/rumpkern/scheduler.c index 317bdcae8686..6018999508da 100644 --- a/sys/rump/librump/rumpkern/scheduler.c +++ b/sys/rump/librump/rumpkern/scheduler.c @@ -1,4 +1,4 @@ -/* $NetBSD: scheduler.c,v 1.23 2010/12/01 20:29:56 pooka Exp $ */ +/* $NetBSD: scheduler.c,v 1.24 2011/01/11 10:49:20 pooka Exp $ */ /* * Copyright (c) 2010 Antti Kantee. All Rights Reserved. @@ -26,7 +26,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: scheduler.c,v 1.23 2010/12/01 20:29:56 pooka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: scheduler.c,v 1.24 2011/01/11 10:49:20 pooka Exp $"); #include #include @@ -349,9 +349,14 @@ rump_schedule_cpu_interlock(struct lwp *l, void *interlock) void rump_unschedule() { - struct lwp *l; + struct lwp *l = rumpuser_get_curlwp(); +#ifdef DIAGNOSTIC + int nlock; + + KERNEL_UNLOCK_ALL(l, &nlock); + KASSERT(nlock == 0); +#endif - l = rumpuser_get_curlwp(); KASSERT(l->l_mutex == l->l_cpu->ci_schedstate.spc_mutex); rump_unschedule_cpu(l); l->l_mutex = NULL;