aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/fork.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2009-12-21 05:21:15 -0500
committerTakashi Iwai <tiwai@suse.de>2009-12-21 05:21:15 -0500
commitde8853bc38ceab1fa7e7f723b21430d4aad60fea (patch)
tree5084ef51866fd1767324f8dc8eb36e97c55350f5 /kernel/fork.c
parentf5de24b06aa46427500d0fdbe8616b73a71d8c28 (diff)
parent440b004cf953bec2bc8cd91c64ae707fd7e25327 (diff)
Merge remote branch 'alsa/fixes' into fix/hda
Diffstat (limited to 'kernel/fork.c')
-rw-r--r--kernel/fork.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/kernel/fork.c b/kernel/fork.c
index 266c6af6ef1b..1415dc4598ae 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -64,6 +64,7 @@
64#include <linux/magic.h> 64#include <linux/magic.h>
65#include <linux/perf_event.h> 65#include <linux/perf_event.h>
66#include <linux/posix-timers.h> 66#include <linux/posix-timers.h>
67#include <linux/user-return-notifier.h>
67 68
68#include <asm/pgtable.h> 69#include <asm/pgtable.h>
69#include <asm/pgalloc.h> 70#include <asm/pgalloc.h>
@@ -91,7 +92,7 @@ int nr_processes(void)
91 int cpu; 92 int cpu;
92 int total = 0; 93 int total = 0;
93 94
94 for_each_online_cpu(cpu) 95 for_each_possible_cpu(cpu)
95 total += per_cpu(process_counts, cpu); 96 total += per_cpu(process_counts, cpu);
96 97
97 return total; 98 return total;
@@ -249,6 +250,7 @@ static struct task_struct *dup_task_struct(struct task_struct *orig)
249 goto out; 250 goto out;
250 251
251 setup_thread_stack(tsk, orig); 252 setup_thread_stack(tsk, orig);
253 clear_user_return_notifier(tsk);
252 stackend = end_of_stack(tsk); 254 stackend = end_of_stack(tsk);
253 *stackend = STACK_END_MAGIC; /* for overflow detection */ 255 *stackend = STACK_END_MAGIC; /* for overflow detection */
254 256
@@ -570,12 +572,18 @@ void mm_release(struct task_struct *tsk, struct mm_struct *mm)
570 572
571 /* Get rid of any futexes when releasing the mm */ 573 /* Get rid of any futexes when releasing the mm */
572#ifdef CONFIG_FUTEX 574#ifdef CONFIG_FUTEX
573 if (unlikely(tsk->robust_list)) 575 if (unlikely(tsk->robust_list)) {
574 exit_robust_list(tsk); 576 exit_robust_list(tsk);
577 tsk->robust_list = NULL;
578 }
575#ifdef CONFIG_COMPAT 579#ifdef CONFIG_COMPAT
576 if (unlikely(tsk->compat_robust_list)) 580 if (unlikely(tsk->compat_robust_list)) {
577 compat_exit_robust_list(tsk); 581 compat_exit_robust_list(tsk);
582 tsk->compat_robust_list = NULL;
583 }
578#endif 584#endif
585 if (unlikely(!list_empty(&tsk->pi_state_list)))
586 exit_pi_state_list(tsk);
579#endif 587#endif
580 588
581 /* Get rid of any cached register state */ 589 /* Get rid of any cached register state */
@@ -878,6 +886,9 @@ static int copy_signal(unsigned long clone_flags, struct task_struct *tsk)
878 sig->utime = sig->stime = sig->cutime = sig->cstime = cputime_zero; 886 sig->utime = sig->stime = sig->cutime = sig->cstime = cputime_zero;
879 sig->gtime = cputime_zero; 887 sig->gtime = cputime_zero;
880 sig->cgtime = cputime_zero; 888 sig->cgtime = cputime_zero;
889#ifndef CONFIG_VIRT_CPU_ACCOUNTING
890 sig->prev_utime = sig->prev_stime = cputime_zero;
891#endif
881 sig->nvcsw = sig->nivcsw = sig->cnvcsw = sig->cnivcsw = 0; 892 sig->nvcsw = sig->nivcsw = sig->cnvcsw = sig->cnivcsw = 0;
882 sig->min_flt = sig->maj_flt = sig->cmin_flt = sig->cmaj_flt = 0; 893 sig->min_flt = sig->maj_flt = sig->cmin_flt = sig->cmaj_flt = 0;
883 sig->inblock = sig->oublock = sig->cinblock = sig->coublock = 0; 894 sig->inblock = sig->oublock = sig->cinblock = sig->coublock = 0;
@@ -1060,8 +1071,10 @@ static struct task_struct *copy_process(unsigned long clone_flags,
1060 p->gtime = cputime_zero; 1071 p->gtime = cputime_zero;
1061 p->utimescaled = cputime_zero; 1072 p->utimescaled = cputime_zero;
1062 p->stimescaled = cputime_zero; 1073 p->stimescaled = cputime_zero;
1074#ifndef CONFIG_VIRT_CPU_ACCOUNTING
1063 p->prev_utime = cputime_zero; 1075 p->prev_utime = cputime_zero;
1064 p->prev_stime = cputime_zero; 1076 p->prev_stime = cputime_zero;
1077#endif
1065 1078
1066 p->default_timer_slack_ns = current->timer_slack_ns; 1079 p->default_timer_slack_ns = current->timer_slack_ns;
1067 1080
@@ -1304,7 +1317,8 @@ bad_fork_free_pid:
1304 if (pid != &init_struct_pid) 1317 if (pid != &init_struct_pid)
1305 free_pid(pid); 1318 free_pid(pid);
1306bad_fork_cleanup_io: 1319bad_fork_cleanup_io:
1307 put_io_context(p->io_context); 1320 if (p->io_context)
1321 exit_io_context(p);
1308bad_fork_cleanup_namespaces: 1322bad_fork_cleanup_namespaces:
1309 exit_task_namespaces(p); 1323 exit_task_namespaces(p);
1310bad_fork_cleanup_mm: 1324bad_fork_cleanup_mm: