[PATCH] lockdep: stacktrace subsystem, i386 support
[pandora-kernel.git] / kernel / exit.c
index e76bd02..c595db1 100644 (file)
@@ -4,7 +4,6 @@
  *  Copyright (C) 1991, 1992  Linus Torvalds
  */
 
-#include <linux/config.h>
 #include <linux/mm.h>
 #include <linux/slab.h>
 #include <linux/interrupt.h>
@@ -137,12 +136,8 @@ void release_task(struct task_struct * p)
 {
        int zap_leader;
        task_t *leader;
-       struct dentry *proc_dentry;
-
 repeat:
        atomic_dec(&p->user->processes);
-       spin_lock(&p->proc_lock);
-       proc_dentry = proc_pid_unhash(p);
        write_lock_irq(&tasklist_lock);
        ptrace_unlink(p);
        BUG_ON(!list_empty(&p->ptrace_list) || !list_empty(&p->ptrace_children));
@@ -171,8 +166,7 @@ repeat:
 
        sched_exit(p);
        write_unlock_irq(&tasklist_lock);
-       spin_unlock(&p->proc_lock);
-       proc_pid_flush(proc_dentry);
+       proc_flush_task(p);
        release_thread(p);
        call_rcu(&p->rcu, delayed_put_task_struct);
 
@@ -931,9 +925,17 @@ fastcall NORET_TYPE void do_exit(long code)
        tsk->mempolicy = NULL;
 #endif
        /*
-        * If DEBUG_MUTEXES is on, make sure we are holding no locks:
+        * This must happen late, after the PID is not
+        * hashed anymore:
+        */
+       if (unlikely(!list_empty(&tsk->pi_state_list)))
+               exit_pi_state_list(tsk);
+       if (unlikely(current->pi_state_cache))
+               kfree(current->pi_state_cache);
+       /*
+        * Make sure we are holding no locks:
         */
-       mutex_debug_check_no_locks_held(tsk);
+       debug_check_no_locks_held(tsk);
 
        if (tsk->io_context)
                exit_io_context();