[PATCH] swsusp: rework image freeing
[cascardo/linux.git] / kernel / exit.c
index 4897977..79f52b8 100644 (file)
@@ -825,13 +825,24 @@ fastcall NORET_TYPE void do_exit(long code)
 
        tsk->flags |= PF_EXITING;
 
+       /*
+        * Make sure we don't try to process any timer firings
+        * while we are already exiting.
+        */
+       tsk->it_virt_expires = cputime_zero;
+       tsk->it_prof_expires = cputime_zero;
+       tsk->it_sched_expires = 0;
+
        if (unlikely(in_atomic()))
                printk(KERN_INFO "note: %s[%d] exited with preempt_count %d\n",
                                current->comm, current->pid,
                                preempt_count());
 
        acct_update_integrals(tsk);
-       update_mem_hiwater(tsk);
+       if (tsk->mm) {
+               update_hiwater_rss(tsk->mm);
+               update_hiwater_vm(tsk->mm);
+       }
        group_dead = atomic_dec_and_test(&tsk->signal->live);
        if (group_dead) {
                del_timer_sync(&tsk->signal->real_timer);