diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-02-11 03:22:04 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-02-11 03:22:04 -0500 |
commit | 95fd4845ed0ffcab305b4f30ce1c12dc34f1b56c (patch) | |
tree | aa2aac22a5b329b778a6771a87bbf1945ad49bbd /kernel/fork.c | |
parent | d278c48435625cb6b7edcf6a547620768b175709 (diff) | |
parent | 8e4921515c1a379539607eb443d51c30f4f7f338 (diff) |
Merge commit 'v2.6.29-rc4' into perfcounters/core
Conflicts:
arch/x86/kernel/setup_percpu.c
arch/x86/mm/fault.c
drivers/acpi/processor_idle.c
kernel/irq/handle.c
Diffstat (limited to 'kernel/fork.c')
-rw-r--r-- | kernel/fork.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/kernel/fork.c b/kernel/fork.c index 0181b7b2281a..b01c5b04bcff 100644 --- a/kernel/fork.c +++ b/kernel/fork.c | |||
@@ -822,17 +822,17 @@ static void posix_cpu_timers_init_group(struct signal_struct *sig) | |||
822 | static int copy_signal(unsigned long clone_flags, struct task_struct *tsk) | 822 | static int copy_signal(unsigned long clone_flags, struct task_struct *tsk) |
823 | { | 823 | { |
824 | struct signal_struct *sig; | 824 | struct signal_struct *sig; |
825 | int ret; | ||
826 | 825 | ||
827 | if (clone_flags & CLONE_THREAD) { | 826 | if (clone_flags & CLONE_THREAD) { |
828 | ret = thread_group_cputime_clone_thread(current); | 827 | atomic_inc(¤t->signal->count); |
829 | if (likely(!ret)) { | 828 | atomic_inc(¤t->signal->live); |
830 | atomic_inc(¤t->signal->count); | 829 | return 0; |
831 | atomic_inc(¤t->signal->live); | ||
832 | } | ||
833 | return ret; | ||
834 | } | 830 | } |
835 | sig = kmem_cache_alloc(signal_cachep, GFP_KERNEL); | 831 | sig = kmem_cache_alloc(signal_cachep, GFP_KERNEL); |
832 | |||
833 | if (sig) | ||
834 | posix_cpu_timers_init_group(sig); | ||
835 | |||
836 | tsk->signal = sig; | 836 | tsk->signal = sig; |
837 | if (!sig) | 837 | if (!sig) |
838 | return -ENOMEM; | 838 | return -ENOMEM; |
@@ -869,8 +869,6 @@ static int copy_signal(unsigned long clone_flags, struct task_struct *tsk) | |||
869 | memcpy(sig->rlim, current->signal->rlim, sizeof sig->rlim); | 869 | memcpy(sig->rlim, current->signal->rlim, sizeof sig->rlim); |
870 | task_unlock(current->group_leader); | 870 | task_unlock(current->group_leader); |
871 | 871 | ||
872 | posix_cpu_timers_init_group(sig); | ||
873 | |||
874 | acct_init_pacct(&sig->pacct); | 872 | acct_init_pacct(&sig->pacct); |
875 | 873 | ||
876 | tty_audit_fork(sig); | 874 | tty_audit_fork(sig); |
@@ -1013,6 +1011,7 @@ static struct task_struct *copy_process(unsigned long clone_flags, | |||
1013 | * triggers too late. This doesn't hurt, the check is only there | 1011 | * triggers too late. This doesn't hurt, the check is only there |
1014 | * to stop root fork bombs. | 1012 | * to stop root fork bombs. |
1015 | */ | 1013 | */ |
1014 | retval = -EAGAIN; | ||
1016 | if (nr_threads >= max_threads) | 1015 | if (nr_threads >= max_threads) |
1017 | goto bad_fork_cleanup_count; | 1016 | goto bad_fork_cleanup_count; |
1018 | 1017 | ||