From: Oleg Nesterov Add the temporary (for -mm only) debugging code to catch the unbalanced put_pid()'s. At least those which can free the "live" pid. Signed-off-by: Oleg Nesterov Cc: Roland McGrath Cc: "Eric W. Biederman" Cc: Pavel Emelyanov Cc: Kamalesh Babulal Cc: Alan Cox Cc: Valdis.Kletnieks@vt.edu Signed-off-by: Andrew Morton --- kernel/pid.c | 4 ++++ 1 file changed, 4 insertions(+) diff -puN kernel/pid.c~put_pid-make-sure-we-dont-free-the-live-pid kernel/pid.c --- a/kernel/pid.c~put_pid-make-sure-we-dont-free-the-live-pid +++ a/kernel/pid.c @@ -210,6 +210,10 @@ void put_pid(struct pid *pid) ns = pid->numbers[pid->level].ns; if ((atomic_read(&pid->count) == 1) || atomic_dec_and_test(&pid->count)) { + int type = PIDTYPE_MAX; + while (--type >= 0) + if (WARN_ON(!hlist_empty(&pid->tasks[type]))) + return; kmem_cache_free(ns->pid_cachep, pid); put_pid_ns(ns); } _