Source-Changes-HG archive

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

[src/trunk]: src/sys/kern - exit1(): for DIAGNOSTIC, call kernel_lock_plug_le...



details:   https://anonhg.NetBSD.org/src/rev/9e184eb59b0e
branches:  trunk
changeset: 1006788:9e184eb59b0e
user:      ad <ad%NetBSD.org@localhost>
date:      Mon Jan 27 21:09:33 2020 +0000

description:
- exit1(): for DIAGNOSTIC, call kernel_lock_plug_leak() (temporary).

- exit_lwps(): call lwp_need_userret() or LWP might never notice.

diffstat:

 sys/kern/kern_exit.c |  9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diffs (44 lines):

diff -r 81972cb622d3 -r 9e184eb59b0e sys/kern/kern_exit.c
--- a/sys/kern/kern_exit.c      Mon Jan 27 21:05:43 2020 +0000
+++ b/sys/kern/kern_exit.c      Mon Jan 27 21:09:33 2020 +0000
@@ -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 <sys/cdefs.h>
-__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 @@
 #include <sys/syscallargs.h>
 #include <sys/kauth.h>
 #include <sys/sleepq.h>
+#include <sys/lock.h>
 #include <sys/lockdebug.h>
 #include <sys/ktrace.h>
 #include <sys/cpu.h>
@@ -204,6 +205,9 @@
 
        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 @@
                        setrunnable(l2);
                        continue;
                }
+               lwp_need_userret(l2);
                lwp_unlock(l2);
        }
 



Home | Main Index | Thread Index | Old Index