patch-2.1.79 linux/kernel/fork.c

Next file: linux/kernel/sched.c
Previous file: linux/kernel/exit.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.78/linux/kernel/fork.c linux/kernel/fork.c
@@ -435,6 +435,7 @@
  */
 int do_fork(unsigned long clone_flags, unsigned long usp, struct pt_regs *regs)
 {
+        int i;
 	int nr;
 	int error = -ENOMEM;
 	struct task_struct *p;
@@ -482,6 +483,9 @@
 #ifdef __SMP__
 	p->has_cpu = 0;
 	p->processor = NO_PROC_ID;
+	/* ?? should we just memset this ?? */
+	for(i = 0; i < smp_num_cpus; i++)
+		p->per_cpu_utime[i] = p->per_cpu_stime[i] = 0;
 #endif
 	p->lock_depth = 0;
 	p->start_time = jiffies;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov