HomeFreeBSD

racct: Improve handling of the pcpu resource

Description

racct: Improve handling of the pcpu resource

The previous scheme would inflate the CPU consumption of short-lived
processes. For containers (e.g., processes, jails), the total pcpu
usage was computed as a sum of the pcpu usage of all constituent
threads, which makes little sense for a decaying average.

Instead, aggregate wallclock time of all on-CPU threads and compute the
pcpu resource as a decaying average as the sum. This gives much more
reasonable and accurate values in various simple tests.

PR: 235556
Reviewed by: markj
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D30878

Details

Provenance
cyril_freebsdfoundation.orgAuthored on Aug 5 2025, 11:20 PM
markjCommitted on Aug 5 2025, 11:33 PM
Reviewer
markj
Differential Revision
D30878: racct: New scheme for calculating pctcpu
Parents
rGb4894eca1ade: Merge bmake-20250804
Branches
Unknown
Tags
Unknown

Event Timeline