Page MenuHomeFreeBSD

racct: Remove factor in pcpu estimate
Needs ReviewPublic

Authored by cyril_freebsdfoundation.org on Thu, Jun 3, 8:54 PM.

Details

Reviewers
markj
trasz
Summary

The runtime value is multiplied by 1000000, but it is already in microseconds, resulting in a very large estimate.
Removing this extra factor of 1000000 should fix bug #235556.
Note that this estimate is only used for short-lived processes.

Diff Detail

Repository
R10 FreeBSD src repository
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

The patch works like a charm! This fixes the case I described here (https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=235556#c2), the stats are now correct: https://www.bsdstore.ru/trash/racct.png
Tested on: FreeBSD 14.0-CURRENT #0 main-n247127-1976e079544-dirty

I would suggest noting in the description/commit log message that this estimate is used only for short-lived processes.

sys/kern/kern_racct.c
327

Style: missing parens around the return value.

This revision is now accepted and ready to land.Fri, Jun 4, 1:01 PM
This revision now requires review to proceed.Fri, Jun 4, 4:22 PM