From 8959bb6327f3fa6b65eb904e0ed86a2ff169f50d Mon Sep 17 00:00:00 2001 From: ad Date: Mon, 27 Jan 2020 21:09:33 +0000 Subject: [PATCH] - exit1(): for DIAGNOSTIC, call kernel_lock_plug_leak() (temporary). - exit_lwps(): call lwp_need_userret() or LWP might never notice. --- sys/kern/kern_exit.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c index 0c5034bb6401..63ddfc385762 100644 --- a/sys/kern/kern_exit.c +++ b/sys/kern/kern_exit.c @@ -1,4 +1,4 @@ -/* $NetBSD: kern_exit.c,v 1.280 2020/01/22 12:23:04 ad Exp $ */ +/* $NetBSD: kern_exit.c,v 1.281 2020/01/27 21:09:33 ad Exp $ */ /*- * Copyright (c) 1998, 1999, 2006, 2007, 2008 The NetBSD Foundation, Inc. @@ -67,7 +67,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kern_exit.c,v 1.280 2020/01/22 12:23:04 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_exit.c,v 1.281 2020/01/27 21:09:33 ad Exp $"); #include "opt_ktrace.h" #include "opt_dtrace.h" @@ -99,6 +99,7 @@ __KERNEL_RCSID(0, "$NetBSD: kern_exit.c,v 1.280 2020/01/22 12:23:04 ad Exp $"); #include #include #include +#include #include #include #include @@ -204,6 +205,9 @@ exit1(struct lwp *l, int exitcode, int signo) p = l->l_proc; + /* XXX Temporary. */ + kernel_lock_plug_leak(); + /* Verify that we hold no locks other than p->p_lock. */ LOCKDEBUG_BARRIER(p->p_lock, 0); KASSERTMSG(curcpu()->ci_biglock_count == 0, "kernel_lock leaked"); @@ -617,6 +621,7 @@ retry: setrunnable(l2); continue; } + lwp_need_userret(l2); lwp_unlock(l2); }