Page MenuHomeFreeBSD

racct: Simplify skipping idle process in the throttling daemon
ClosedPublic

Authored by olce on Wed, Oct 29, 8:52 PM.
Tags
None
Referenced Files
F134992940: D53455.diff
Wed, Nov 5, 4:49 PM
F134984476: D53455.id.diff
Wed, Nov 5, 3:15 PM
F134983332: D53455.id165687.diff
Wed, Nov 5, 3:04 PM
F134982506: D53455.id165358.diff
Wed, Nov 5, 2:55 PM
F134982160: D53455.diff
Wed, Nov 5, 2:51 PM
Unknown Object (File)
Mon, Nov 3, 5:16 PM
Unknown Object (File)
Mon, Nov 3, 5:16 PM
Unknown Object (File)
Mon, Nov 3, 5:16 PM
Subscribers

Details

Summary

In racctd(), commit c72188d85a79 ("racct: Improve handling of the pcpu
resource") added a superfluous test to skip the idle process when
computing the resource usage and checking for limits, consisting of
a comparison of the considered process' pointer with that of the process of
the first CPU's idle thread. The P_IDLEPROC flag introduced in commit
33be1632047c ("racct: Fix accounting of CPU time for the system idle
process") is sufficient and simpler for this purpose.

In the second loop throttling processes based on their %CPU usage, the
test excluding processes not in PRS_NORMAL was not consistent with that
of the first loop (which tests for the idle process also). This had no
practical consequences except a superfluous call to
racct_pcpu_available() as the RACCT_PCTCPU counter stays at 0 on the
idle process (because of the first loop). Factor out the test in the
new racct_proc_to_skip() function.

No functional change intended.

Sponsored by: The FreeBSD Foundation

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable