proc0_post: Clear relevant thread stats directly

rufetch() has several other effects besides clearing these per-thread
stats most of which are explicitly discarded by the subsequent calls
to ruxreset().  Just clear the relevant stats directly instead.

Reviewed by:	olce, kib, markj
Differential Revision:	https://reviews.freebsd.org/D54050
This commit is contained in:
John Baldwin
2025-12-08 11:15:52 -05:00
parent dafe50ebd8
commit acd02443a9
+6 -3
View File
@@ -643,7 +643,6 @@ static void
proc0_post(void *dummy __unused)
{
struct proc *p;
struct rusage ru;
struct thread *td;
/*
@@ -660,11 +659,15 @@ proc0_post(void *dummy __unused)
}
microuptime(&p->p_stats->p_start);
PROC_STATLOCK(p);
rufetch(p, &ru); /* Clears thread stats */
ruxreset(&p->p_rux);
FOREACH_THREAD_IN_PROC(p, td) {
td->td_runtime = 0;
thread_lock(td);
td->td_incruntime = 0;
td->td_runtime = 0;
td->td_pticks = 0;
td->td_sticks = 0;
td->td_iticks = 0;
td->td_uticks = 0;
ruxreset(&td->td_rux);
thread_unlock(td);
}