From 93c8bfe7407ee796d62971625964d37adab29945 Mon Sep 17 00:00:00 2001 From: Thorsten Lockert Date: Thu, 15 Aug 1996 21:51:51 +0000 Subject: Clear p_pctcpu when a process exit --- sys/kern/kern_exit.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'sys') diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c index aa3177dbe6f..f3f9803db6b 100644 --- a/sys/kern/kern_exit.c +++ b/sys/kern/kern_exit.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_exit.c,v 1.6 1996/05/02 13:12:11 deraadt Exp $ */ +/* $OpenBSD: kern_exit.c,v 1.7 1996/08/15 21:51:50 tholo Exp $ */ /* $NetBSD: kern_exit.c,v 1.39 1996/04/22 01:38:25 christos Exp $ */ /* @@ -238,6 +238,11 @@ exit1(p, rv) calcru(p, &p->p_ru->ru_utime, &p->p_ru->ru_stime, NULL); ruadd(p->p_ru, &p->p_stats->p_cru); + /* + * clear %cpu usage during swap + */ + p->p_pctcpu = 0; + /* * Notify parent that we're gone. */ -- cgit v1.2.3