Merge tag 'v3.10.74' into update
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / kernel / exit.c
index 6682b2ea5b11aa3680fe4ccdf62e8d384ddc78b0..b75ebb365ce5ff39c27872e982ab47fc2001c64f 100644 (file)
 #include <asm/pgtable.h>
 #include <asm/mmu_context.h>
 
+#ifdef CONFIG_MT_PRIO_TRACER
+# include <linux/prio_tracer.h>
+#endif
+
 static void exit_mm(struct task_struct * tsk);
 
 static void __unhash_process(struct task_struct *p, bool group_dead)
@@ -74,6 +78,7 @@ static void __unhash_process(struct task_struct *p, bool group_dead)
                __this_cpu_dec(process_counts);
        }
        list_del_rcu(&p->thread_group);
+       list_del_rcu(&p->thread_node);
 }
 
 /*
@@ -711,12 +716,25 @@ static void check_stack_usage(void)
 static inline void check_stack_usage(void) {}
 #endif
 
+#ifdef CONFIG_SCHEDSTATS
+/* mt shceduler profiling*/
+extern void end_mtproc_info(struct task_struct *p);
+#endif
 void do_exit(long code)
 {
        struct task_struct *tsk = current;
        int group_dead;
 
        profile_task_exit(tsk);
+#ifdef CONFIG_SCHEDSTATS
+       /* mt shceduler profiling*/
+       printk(KERN_DEBUG "[%d:%s] exit\n", tsk->pid, tsk->comm);
+       end_mtproc_info(tsk);
+#endif
+
+#ifdef CONFIG_MT_PRIO_TRACER
+       delete_prio_tracer(tsk->pid);
+#endif
 
        WARN_ON(blk_needs_flush_plug(tsk));
 
@@ -840,7 +858,7 @@ void do_exit(long code)
        /*
         * Make sure we are holding no locks:
         */
-       debug_check_no_locks_held(tsk);
+       debug_check_no_locks_held();
        /*
         * We can do this unlocked here. The futex code uses this flag
         * just to verify whether the pi state cleanup has been done