Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 07 Feb 2019 10:44:54 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 235556] rctl(8) pcpu/cputime is too high
Message-ID:  <bug-235556-227-7guz8yPQOa@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-235556-227@https.bugs.freebsd.org/bugzilla/>
References:  <bug-235556-227@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D235556

--- Comment #2 from olevole@olevole.ru ---
RACCT pcpu metrics are incorrect when processes end quickly.

What i expect:
 maximum value for 1-core process: 100

What i get:
 100x256

It is not an artificial or abstract state. For example this behavior is eas=
y to
see when working 'make config' for autotools with the launch of a lot of sh=
ort
calls (e.g env BATCH=3Dno make -C /usr/ports/misc/mc clean configure). This=
 makes
it impossible to use any external billing based on RACCT.=20

How to reproduce ( we use cpuset here to create load on only one core. So we
should have pcpu=3D100 for jail assuming the jail does nothing else ):

1) Run jail1
2) Try to execute ant fast/light external command (e.g. /bin/ls ) in the lo=
op.
For more convincing create a simple utility:

---
#include <stdio.h>

int main()
{
return 0;
}
---

Write execution loop and drop it into jail, e.g /root/run.sh:
---
#!/bin/sh

while [ 1 ]; do
/root/a.out > /dev/null
done
---

Run inside jail this script via cpuset:

cpuset -c -l 0 /bin/sh /root/run.sh


After this we can see on the 'top -P' something like:
---
182 processes: 2 running, 180 sleeping
CPU 0: 34.1% user,  0.0% nice, 65.9% system,  0.0% interrupt,  0.0% idle
CPU 1:  0.5% user,  0.0% nice,  0.0% system,  0.0% interrupt, 99.5% idle
CPU 2:  3.1% user,  0.0% nice,  1.2% system,  0.0% interrupt, 95.7% idle
CPU 3:  0.0% user,  0.0% nice,  0.4% system,  0.0% interrupt, 99.6% idle
CPU 4:  1.2% user,  0.0% nice,  0.8% system,  0.0% interrupt, 98.1% idle
CPU 5:  0.8% user,  0.0% nice,  0.4% system,  0.0% interrupt, 98.8% idle
CPU 6:  1.2% user,  0.0% nice,  0.0% system,  0.0% interrupt, 98.8% idle
CPU 7:  0.4% user,  0.0% nice,  0.4% system,  0.0% interrupt, 99.2% idle
...

  PID USERNAME       THR PRI NICE   SIZE    RES STATE   C   TIME    WCPU
COMMAND
41437 root             1  76    0 11408K  2232K CPU0    0   0:07  12.79% sh
...
---


Only one core is busy. However if we look at the RACCT from the hoster side=
, we
see the following:

freebsd:~ # rctl -u jail:jail1 | grep pcpu
pcpu=3D25600
freebsd:~ # rctl -u jail:jail1 | grep pcpu
pcpu=3D25600
freebsd:~ # rctl -u jail:jail1 | grep pcpu
pcpu=3D25600

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-235556-227-7guz8yPQOa>