Module Name: src
Committed By: bouyer
Date: Wed May 21 21:04:31 UTC 2014
Modified Files:
src/sys/kern [netbsd-6]: kern_exit.c
Log Message:
Pull up following revision(s) (requested by christos in ticket #1061):
sys/kern/kern_exit.c: revision 1.244
Free pid for linux processes. Reported by Mark Davies, fix by dsl@
XXX: pullup 6
To generate a diff of this commit:
cvs rdiff -u -r1.236.2.2 -r1.236.2.3 src/sys/kern/kern_exit.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/kern/kern_exit.c
diff -u src/sys/kern/kern_exit.c:1.236.2.2 src/sys/kern/kern_exit.c:1.236.2.3
--- src/sys/kern/kern_exit.c:1.236.2.2 Mon Oct 1 23:07:07 2012
+++ src/sys/kern/kern_exit.c Wed May 21 21:04:31 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_exit.c,v 1.236.2.2 2012/10/01 23:07:07 riz Exp $ */
+/* $NetBSD: kern_exit.c,v 1.236.2.3 2014/05/21 21:04:31 bouyer 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.236.2.2 2012/10/01 23:07:07 riz Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_exit.c,v 1.236.2.3 2014/05/21 21:04:31 bouyer Exp $");
#include "opt_ktrace.h"
#include "opt_perfctrs.h"
@@ -540,12 +540,10 @@ exit1(struct lwp *l, int rv)
*/
pcu_discard_all(l);
- /*
- * Remaining lwp resources will be freed in lwp_exit2() once we've
- * switch to idle context; at that point, we will be marked as a
- * full blown zombie.
- */
mutex_enter(p->p_lock);
+ /* Free the linux lwp id */
+ if ((l->l_pflag & LP_PIDLID) != 0 && l->l_lid != p->p_pid)
+ proc_free_pid(l->l_lid);
lwp_drainrefs(l);
lwp_lock(l);
l->l_prflag &= ~LPR_DETACHED;