diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-01-18 12:37:14 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-01-18 12:37:14 -0500 |
commit | b2b062b8163391c42b3219d466ca1ac9742b9c7b (patch) | |
tree | f3f920c09b8de694b1bc1d4b878cfd2b0b98c913 /kernel/exit.c | |
parent | a9de18eb761f7c1c860964b2e5addc1a35c7e861 (diff) | |
parent | 99937d6455cea95405ac681c86a857d0fcd530bd (diff) |
Merge branch 'core/percpu' into stackprotector
Conflicts:
arch/x86/include/asm/pda.h
arch/x86/include/asm/system.h
Also, moved include/asm-x86/stackprotector.h to arch/x86/include/asm.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/exit.c')
-rw-r--r-- | kernel/exit.c | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/kernel/exit.c b/kernel/exit.c index e69edc74aeeb..2a803c28df9e 100644 --- a/kernel/exit.c +++ b/kernel/exit.c | |||
@@ -642,35 +642,31 @@ retry: | |||
642 | /* | 642 | /* |
643 | * We found no owner yet mm_users > 1: this implies that we are | 643 | * We found no owner yet mm_users > 1: this implies that we are |
644 | * most likely racing with swapoff (try_to_unuse()) or /proc or | 644 | * most likely racing with swapoff (try_to_unuse()) or /proc or |
645 | * ptrace or page migration (get_task_mm()). Mark owner as NULL, | 645 | * ptrace or page migration (get_task_mm()). Mark owner as NULL. |
646 | * so that subsystems can understand the callback and take action. | ||
647 | */ | 646 | */ |
648 | down_write(&mm->mmap_sem); | ||
649 | cgroup_mm_owner_callbacks(mm->owner, NULL); | ||
650 | mm->owner = NULL; | 647 | mm->owner = NULL; |
651 | up_write(&mm->mmap_sem); | ||
652 | return; | 648 | return; |
653 | 649 | ||
654 | assign_new_owner: | 650 | assign_new_owner: |
655 | BUG_ON(c == p); | 651 | BUG_ON(c == p); |
656 | get_task_struct(c); | 652 | get_task_struct(c); |
657 | read_unlock(&tasklist_lock); | ||
658 | down_write(&mm->mmap_sem); | ||
659 | /* | 653 | /* |
660 | * The task_lock protects c->mm from changing. | 654 | * The task_lock protects c->mm from changing. |
661 | * We always want mm->owner->mm == mm | 655 | * We always want mm->owner->mm == mm |
662 | */ | 656 | */ |
663 | task_lock(c); | 657 | task_lock(c); |
658 | /* | ||
659 | * Delay read_unlock() till we have the task_lock() | ||
660 | * to ensure that c does not slip away underneath us | ||
661 | */ | ||
662 | read_unlock(&tasklist_lock); | ||
664 | if (c->mm != mm) { | 663 | if (c->mm != mm) { |
665 | task_unlock(c); | 664 | task_unlock(c); |
666 | up_write(&mm->mmap_sem); | ||
667 | put_task_struct(c); | 665 | put_task_struct(c); |
668 | goto retry; | 666 | goto retry; |
669 | } | 667 | } |
670 | cgroup_mm_owner_callbacks(mm->owner, c); | ||
671 | mm->owner = c; | 668 | mm->owner = c; |
672 | task_unlock(c); | 669 | task_unlock(c); |
673 | up_write(&mm->mmap_sem); | ||
674 | put_task_struct(c); | 670 | put_task_struct(c); |
675 | } | 671 | } |
676 | #endif /* CONFIG_MM_OWNER */ | 672 | #endif /* CONFIG_MM_OWNER */ |
@@ -1052,10 +1048,7 @@ NORET_TYPE void do_exit(long code) | |||
1052 | preempt_count()); | 1048 | preempt_count()); |
1053 | 1049 | ||
1054 | acct_update_integrals(tsk); | 1050 | acct_update_integrals(tsk); |
1055 | if (tsk->mm) { | 1051 | |
1056 | update_hiwater_rss(tsk->mm); | ||
1057 | update_hiwater_vm(tsk->mm); | ||
1058 | } | ||
1059 | group_dead = atomic_dec_and_test(&tsk->signal->live); | 1052 | group_dead = atomic_dec_and_test(&tsk->signal->live); |
1060 | if (group_dead) { | 1053 | if (group_dead) { |
1061 | hrtimer_cancel(&tsk->signal->real_timer); | 1054 | hrtimer_cancel(&tsk->signal->real_timer); |