patch-1.3.81 linux/kernel/sched.c
Next file: linux/net/802/Makefile
Previous file: linux/include/net/p8022trcall.h
Back to the patch index
Back to the overall index
-  Lines: 34
 -  Date:
Fri Mar 29 12:58:04 1996
 -  Orig file: 
v1.3.80/linux/kernel/sched.c
 -  Orig date: 
Thu Mar 28 17:34:35 1996
 
diff -u --recursive --new-file v1.3.80/linux/kernel/sched.c linux/kernel/sched.c
@@ -861,11 +861,6 @@
 	long psecs;
 
 	p->utime += user;
-	if (p->priority < DEF_PRIORITY)
-		kstat.cpu_nice += user;
-	else
-		kstat.cpu_user += user;
-	kstat.cpu_system += system;
 	p->stime += system;
 
 	psecs = (p->stime + p->utime) / HZ;
@@ -917,14 +912,20 @@
 {
 #ifndef  __SMP__
 	struct task_struct * p = current;
+	unsigned long user = ticks - system;
 	if (p->pid) {
 		p->counter -= ticks;
 		if (p->counter < 0) {
 			p->counter = 0;
 			need_resched = 1;
 		}
+		if (p->priority < DEF_PRIORITY)
+			kstat.cpu_nice += user;
+		else
+			kstat.cpu_user += user;
+		kstat.cpu_system += system;
 	}
-	update_one_process(p, ticks, ticks-system, system);
+	update_one_process(p, ticks, user, system);
 #else
 	int cpu,j;
 	cpu = smp_processor_id();
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov
with Sam's (original) version of this