Fixed minor bug in PM's child time administration.

This commit is contained in:
Jorrit Herder 2005-06-01 08:55:22 +00:00
parent 5a43b84e2d
commit a3d2f35993
2 changed files with 6 additions and 6 deletions

View file

@ -200,9 +200,7 @@ irq_hook_t *hook;
* processing by one tick, or call the high level unnecessarily.
* The variables which are changed require more care:
* rp->p_user_time, rp->p_sys_time:
* These are protected by explicit locks in system.c. They are
* not properly protected in dmp.c (the increment here is not
* atomic) but that hardly matters.
* These are protected by explicit locks in system.c.
* pending_ticks:
* This is protected by explicit locks in clock.c. Don't
* update realtime directly, since there are too many

View file

@ -77,6 +77,8 @@ PUBLIC int do_fork()
rmc->mp_parent = who; /* record child's parent */
rmc->mp_flags &= (IN_USE|SEPARATE); /* inherit only these flags */
rmc->mp_child_utime = 0; /* reset administration */
rmc->mp_child_stime = 0; /* reset administration */
/* A separate I&D child keeps the parents text segment. The data and stack
* segments must refer to the new copy.
@ -145,9 +147,9 @@ int exit_status; /* the process' exit status (for parent) */
/* Do accounting: fetch usage times and accumulate at parent. */
sys_times(proc_nr, t);
p_mp = &mproc[rmp->mp_parent]; /* process' parent */
p_mp->mp_child_utime = t[2];
p_mp->mp_child_stime = t[3];
p_mp = &mproc[rmp->mp_parent]; /* process' parent */
p_mp->mp_child_utime += t[0] + rmp->mp_child_utime; /* add user time */
p_mp->mp_child_stime += t[1] + rmp->mp_child_stime; /* add system time */
/* Tell the kernel and FS that the process is no longer runnable. */
tell_fs(EXIT, proc_nr, 0, 0); /* file system can free the proc slot */