aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/fork.c
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2008-11-24 11:06:57 -0500
committerIngo Molnar <mingo@elte.hu>2009-01-07 12:52:44 -0500
commit490dea45d00f01847ebebd007685d564aaf2cd98 (patch)
treea1f559fd497b10c21479b378ffb262d517cb627b /kernel/fork.c
parentede6f5aea054d3fb67c78857f7abdee602302043 (diff)
itimers: remove the per-cpu-ish-ness
Either we bounce once cacheline per cpu per tick, yielding n^2 bounces or we just bounce a single.. Also, using per-cpu allocations for the thread-groups complicates the per-cpu allocator in that its currently aimed to be a fixed sized allocator and the only possible extention to that would be vmap based, which is seriously constrained on 32 bit archs. So making the per-cpu memory requirement depend on the number of processes is an issue. Lastly, it didn't deal with cpu-hotplug, although admittedly that might be fixable. Signed-off-by: Peter Zijlstra <peterz@infradead.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/fork.c')
-rw-r--r--kernel/fork.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/kernel/fork.c b/kernel/fork.c
index 7b8f2a78be3d..7087d8c0e5e2 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -820,14 +820,15 @@ static int copy_signal(unsigned long clone_flags, struct task_struct *tsk)
820 int ret; 820 int ret;
821 821
822 if (clone_flags & CLONE_THREAD) { 822 if (clone_flags & CLONE_THREAD) {
823 ret = thread_group_cputime_clone_thread(current); 823 atomic_inc(&current->signal->count);
824 if (likely(!ret)) { 824 atomic_inc(&current->signal->live);
825 atomic_inc(&current->signal->count); 825 return 0;
826 atomic_inc(&current->signal->live);
827 }
828 return ret;
829 } 826 }
830 sig = kmem_cache_alloc(signal_cachep, GFP_KERNEL); 827 sig = kmem_cache_alloc(signal_cachep, GFP_KERNEL);
828
829 if (sig)
830 posix_cpu_timers_init_group(sig);
831
831 tsk->signal = sig; 832 tsk->signal = sig;
832 if (!sig) 833 if (!sig)
833 return -ENOMEM; 834 return -ENOMEM;
@@ -864,8 +865,6 @@ static int copy_signal(unsigned long clone_flags, struct task_struct *tsk)
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);