Module Name: src
Committed By: christos
Date: Mon May 5 15:45:32 UTC 2014
Modified Files:
src/sys/kern: kern_exit.c
Log Message:
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.243 -r1.244 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.243 src/sys/kern/kern_exit.c:1.244
--- src/sys/kern/kern_exit.c:1.243 Sat Jun 8 21:13:47 2013
+++ src/sys/kern/kern_exit.c Mon May 5 11:45:32 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_exit.c,v 1.243 2013/06/09 01:13:47 riz Exp $ */
+/* $NetBSD: kern_exit.c,v 1.244 2014/05/05 15:45:32 christos 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.243 2013/06/09 01:13:47 riz Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_exit.c,v 1.244 2014/05/05 15:45:32 christos Exp $");
#include "opt_ktrace.h"
#include "opt_perfctrs.h"
@@ -541,12 +541,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;