]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - kernel/exit.c
[PATCH] sched: no aggressive idle balancing
[linux-2.6-omap-h63xx.git] / kernel / exit.c
index 7be283d98983d8cebc6f7853ab3ef233185e7532..3ebcd60a19c69e76bab6d9b70cbd0d75508b3422 100644 (file)
@@ -72,6 +72,11 @@ repeat:
        BUG_ON(!list_empty(&p->ptrace_list) || !list_empty(&p->ptrace_children));
        __exit_signal(p);
        __exit_sighand(p);
+       /*
+        * Note that the fastpath in sys_times depends on __exit_signal having
+        * updated the counters before a task is removed from the tasklist of
+        * the process by __unhash_process.
+        */
        __unhash_process(p);
 
        /*
@@ -793,6 +798,17 @@ fastcall NORET_TYPE void do_exit(long code)
                ptrace_notify((PTRACE_EVENT_EXIT << 8) | SIGTRAP);
        }
 
+       /*
+        * We're taking recursive faults here in do_exit. Safest is to just
+        * leave this task alone and wait for reboot.
+        */
+       if (unlikely(tsk->flags & PF_EXITING)) {
+               printk(KERN_ALERT
+                       "Fixing recursive fault but reboot is needed!\n");
+               set_current_state(TASK_UNINTERRUPTIBLE);
+               schedule();
+       }
+
        tsk->flags |= PF_EXITING;
 
        /*
@@ -811,10 +827,8 @@ fastcall NORET_TYPE void do_exit(long code)
        acct_update_integrals(tsk);
        update_mem_hiwater(tsk);
        group_dead = atomic_dec_and_test(&tsk->signal->live);
-       if (group_dead) {
-               del_timer_sync(&tsk->signal->real_timer);
+       if (group_dead)
                acct_process(code);
-       }
        exit_mm(tsk);
 
        exit_sem(tsk);
@@ -846,6 +860,8 @@ fastcall NORET_TYPE void do_exit(long code)
        for (;;) ;
 }
 
+EXPORT_SYMBOL_GPL(do_exit);
+
 NORET_TYPE void complete_and_exit(struct completion *comp, long code)
 {
        if (comp)