[Bug 269097] rctl(8) seems to include idle time in cputime

From: <bugzilla-noreply_at_freebsd.org>
Date: Sun, 22 Jan 2023 15:51:18 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=269097

            Bug ID: 269097
           Summary: rctl(8) seems to include idle time in cputime
           Product: Base System
           Version: 13.1-RELEASE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: kern
          Assignee: bugs@FreeBSD.org
          Reporter: dfr@rabson.org

I tried to use rctl_get_racct("jail:0", ...) to get metrics for the host but
cputime seems to include time spent in the idle process. On an idle machine
with 16 hardware threads, I ran this:

$ while true; do sudo rctl -u jail:0 | grep cputime; sleep 1; done
cputime=4145725
cputime=4145741
cputime=4145757
cputime=4145773
cputime=4145789

The cputime increases by 16 each time. I was expecting filter jail:0 to show
summary cputime metrics for the host plus jails but instead, it always shows
100% cpu usage. If this is intentional, it should probably be mentioned in the
documentation.

I can probably work around by getting metrics for the idle proc and
subtracting.

-- 
You are receiving this mail because:
You are the assignee for the bug.