diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-03-02 16:08:56 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-03-02 16:08:56 -0500 |
commit | c02368a9d059322f913a58111eade87a656fefd5 (patch) | |
tree | 2f02dbbe69b86535f58d2010d9adfb20a9c16fb9 /kernel/fork.c | |
parent | f17c75453b2d195eba0a90d9f16a3ba88c85b3b4 (diff) | |
parent | 778ef1e6cbb049c9bcbf405936ee6f2b6e451892 (diff) |
Merge branch 'linus' into irq/genirq
Diffstat (limited to 'kernel/fork.c')
-rw-r--r-- | kernel/fork.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/kernel/fork.c b/kernel/fork.c index bf0cef8bbdf2..a66fbde20715 100644 --- a/kernel/fork.c +++ b/kernel/fork.c | |||
@@ -817,17 +817,17 @@ static void posix_cpu_timers_init_group(struct signal_struct *sig) | |||
817 | static int copy_signal(unsigned long clone_flags, struct task_struct *tsk) | 817 | static int copy_signal(unsigned long clone_flags, struct task_struct *tsk) |
818 | { | 818 | { |
819 | struct signal_struct *sig; | 819 | struct signal_struct *sig; |
820 | int ret; | ||
821 | 820 | ||
822 | if (clone_flags & CLONE_THREAD) { | 821 | if (clone_flags & CLONE_THREAD) { |
823 | ret = thread_group_cputime_clone_thread(current); | 822 | atomic_inc(¤t->signal->count); |
824 | if (likely(!ret)) { | 823 | atomic_inc(¤t->signal->live); |
825 | atomic_inc(¤t->signal->count); | 824 | return 0; |
826 | atomic_inc(¤t->signal->live); | ||
827 | } | ||
828 | return ret; | ||
829 | } | 825 | } |
830 | sig = kmem_cache_alloc(signal_cachep, GFP_KERNEL); | 826 | sig = kmem_cache_alloc(signal_cachep, GFP_KERNEL); |
827 | |||
828 | if (sig) | ||
829 | posix_cpu_timers_init_group(sig); | ||
830 | |||
831 | tsk->signal = sig; | 831 | tsk->signal = sig; |
832 | if (!sig) | 832 | if (!sig) |
833 | return -ENOMEM; | 833 | return -ENOMEM; |
@@ -851,21 +851,20 @@ static int copy_signal(unsigned long clone_flags, struct task_struct *tsk) | |||
851 | sig->tty_old_pgrp = NULL; | 851 | sig->tty_old_pgrp = NULL; |
852 | sig->tty = NULL; | 852 | sig->tty = NULL; |
853 | 853 | ||
854 | sig->cutime = sig->cstime = cputime_zero; | 854 | sig->utime = sig->stime = sig->cutime = sig->cstime = cputime_zero; |
855 | sig->gtime = cputime_zero; | 855 | sig->gtime = cputime_zero; |
856 | sig->cgtime = cputime_zero; | 856 | sig->cgtime = cputime_zero; |
857 | sig->nvcsw = sig->nivcsw = sig->cnvcsw = sig->cnivcsw = 0; | 857 | sig->nvcsw = sig->nivcsw = sig->cnvcsw = sig->cnivcsw = 0; |
858 | sig->min_flt = sig->maj_flt = sig->cmin_flt = sig->cmaj_flt = 0; | 858 | sig->min_flt = sig->maj_flt = sig->cmin_flt = sig->cmaj_flt = 0; |
859 | sig->inblock = sig->oublock = sig->cinblock = sig->coublock = 0; | 859 | sig->inblock = sig->oublock = sig->cinblock = sig->coublock = 0; |
860 | task_io_accounting_init(&sig->ioac); | 860 | task_io_accounting_init(&sig->ioac); |
861 | sig->sum_sched_runtime = 0; | ||
861 | taskstats_tgid_init(sig); | 862 | taskstats_tgid_init(sig); |
862 | 863 | ||
863 | task_lock(current->group_leader); | 864 | task_lock(current->group_leader); |
864 | memcpy(sig->rlim, current->signal->rlim, sizeof sig->rlim); | 865 | memcpy(sig->rlim, current->signal->rlim, sizeof sig->rlim); |
865 | task_unlock(current->group_leader); | 866 | task_unlock(current->group_leader); |
866 | 867 | ||
867 | posix_cpu_timers_init_group(sig); | ||
868 | |||
869 | acct_init_pacct(&sig->pacct); | 868 | acct_init_pacct(&sig->pacct); |
870 | 869 | ||
871 | tty_audit_fork(sig); | 870 | tty_audit_fork(sig); |
@@ -1007,6 +1006,7 @@ static struct task_struct *copy_process(unsigned long clone_flags, | |||
1007 | * triggers too late. This doesn't hurt, the check is only there | 1006 | * triggers too late. This doesn't hurt, the check is only there |
1008 | * to stop root fork bombs. | 1007 | * to stop root fork bombs. |
1009 | */ | 1008 | */ |
1009 | retval = -EAGAIN; | ||
1010 | if (nr_threads >= max_threads) | 1010 | if (nr_threads >= max_threads) |
1011 | goto bad_fork_cleanup_count; | 1011 | goto bad_fork_cleanup_count; |
1012 | 1012 | ||
@@ -1095,7 +1095,7 @@ static struct task_struct *copy_process(unsigned long clone_flags, | |||
1095 | #ifdef CONFIG_DEBUG_MUTEXES | 1095 | #ifdef CONFIG_DEBUG_MUTEXES |
1096 | p->blocked_on = NULL; /* not blocked yet */ | 1096 | p->blocked_on = NULL; /* not blocked yet */ |
1097 | #endif | 1097 | #endif |
1098 | if (unlikely(ptrace_reparented(current))) | 1098 | if (unlikely(current->ptrace)) |
1099 | ptrace_fork(p, clone_flags); | 1099 | ptrace_fork(p, clone_flags); |
1100 | 1100 | ||
1101 | /* Perform scheduler related setup. Assign this task to a CPU. */ | 1101 | /* Perform scheduler related setup. Assign this task to a CPU. */ |