os::Linux::get_tick_information calculates the CPUPerfTicks::total field based on /proc/stat.
At this time, the guest field of /proc/stat is also added.
However, the guest field of /proc/stat has already been added to the user field of /proc/stat in the linux kernel.
(Unfortunately, this behavior does not seem to be documented.)
The following is the relevant part in the linux kernel source.
https://github.com/torvalds/linux/blob/v5.16/kernel/sched/cputime.c#L135-L157
Therefore, in the current calclulation method, the guest field of /proc/stat is added twice.
Correctly, the guest field should not be added.
At this time, the guest field of /proc/stat is also added.
However, the guest field of /proc/stat has already been added to the user field of /proc/stat in the linux kernel.
(Unfortunately, this behavior does not seem to be documented.)
The following is the relevant part in the linux kernel source.
https://github.com/torvalds/linux/blob/v5.16/kernel/sched/cputime.c#L135-L157
Therefore, in the current calclulation method, the guest field of /proc/stat is added twice.
Correctly, the guest field should not be added.
- links to
-
Review openjdk/jdk/7303