diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c --- a/sys/kern/init_main.c +++ b/sys/kern/init_main.c @@ -648,7 +648,8 @@ /* * Now we can look at the time, having had a chance to verify the - * time from the filesystem. Pretend that proc0 started now. + * time from the filesystem. Pretend that all current threads + * started now. */ sx_slock(&allproc_lock); FOREACH_PROC_IN_SYSTEM(p) { @@ -661,10 +662,13 @@ PROC_STATLOCK(p); rufetch(p, &ru); /* Clears thread stats */ ruxreset(&p->p_rux); - PROC_STATUNLOCK(p); FOREACH_THREAD_IN_PROC(p, td) { td->td_runtime = 0; + thread_lock(td); + ruxreset(&td->td_rux); + thread_unlock(td); } + PROC_STATUNLOCK(p); PROC_UNLOCK(p); } sx_sunlock(&allproc_lock);