HomeFreeBSD

Set p->p_switchtime to switchtime instead of to the current time in
rS37920Unpublished

Unpublished Commit ยท Learn More

No further details are available.

Description

Set p->p_switchtime to switchtime instead of to the current time in
fork_trampoline() if switchtime is valid. This fixes not accounting
for the time between the previous context switch and and the current
time (when the forked child starts up here) in most cases - the time
is now counted in the child's runtime. I think it actually fixes
all cases, and switchtime is always valid here, since there must have
been a context switch just before the forked child starts up. Some
code should be removed if this is correct. The check that switchtime
is valid sometimes gives a false negative because the check isn't
correct until the after the first context switch after the system
has been up for >= 1 second.

Details

Provenance
bdeAuthored on
Parents
rS37919: Micro-optimized and cleaned up the clearing of switchtime in idle().
Branches
Unknown
Tags
Unknown

Event Timeline