mirror of
https://git.proxmox.com/git/proxmox
synced 2025-05-16 01:49:09 +00:00
procfs: don't count guest and guest_nice times twice
See the following kernel code snippet from kernel/sched/cputime.c's account_guest_time(): /* Add guest time to cpustat. */ if (task_nice(p) > 0) { cpustat[CPUTIME_NICE] += cputime; cpustat[CPUTIME_GUEST_NICE] += cputime; } else { cpustat[CPUTIME_USER] += cputime; cpustat[CPUTIME_GUEST] += cputime; } So the old sum was wrong as some time frames were counted double in the `total` value. The data will likely still deviate from PVE, but we should check by how much, as this version does seem more accurate. We can still fix it to just use the same math as pve if it seems off. Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
c5b2694a44
commit
ce84d19f63
@ -308,8 +308,6 @@ fn parse_proc_stat(statstr: &str) -> Result<ProcFsStat, Error> {
|
||||
+ stat.irq
|
||||
+ stat.softirq
|
||||
+ stat.steal
|
||||
+ stat.guest
|
||||
+ stat.guest_nice
|
||||
+ stat.idle;
|
||||
|
||||
// returns avg. heuristic for the first request
|
||||
|
Loading…
Reference in New Issue
Block a user