linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Is it normal for the user and sys times in /proc/stat to move backwards with NO_HZ?
@ 2025-08-16 14:44 Thomas Lindroth
  0 siblings, 0 replies; only message in thread
From: Thomas Lindroth @ 2025-08-16 14:44 UTC (permalink / raw)
  To: linux-fsdevel; +Cc: Linux Kernel Mailing List

I have noticed that some of the values in /proc/stat, such as user, nice, and sys time,
can decrease on subsequent reads. The file Documentation/filesystems/proc.rst states:
"The value of iowait field in /proc/stat will decrease in certain conditions".
Since the documentation specifically mentions iowait I assume that the other values
should not decrease.

A simple way to test this is by running:
while true; do grep -F "cpu1 " /proc/stat;done| awk 'NR>1{diff=$2-p;if(diff<0)print diff}{p=$2}'

I believe this issue is related to the use of NO_HZ. I use nohz_full=1-23 on an
Intel i7-13700K CPU with 24 logical cores. I have never seen decreasing values on cpu0,
which is the housekeeping CPU with ticks always enabled. I have seen decreasing user,
nice, and sys times on all other cores on kernel 6.12.38 and an older 6.1.140 kernel.

I boot the kernel with the following arguments:
nohz_full=1-23 rcu_nocbs=1-23 intel_iommu=on kvm.ignore_msrs=1 kvm-intel.nested=0
kvm.report_ignored_msrs=0 vfio-pci.disable_vga=1 split_lock_detect=off

If this is expected behaviour it would be helpful if the documentation could be updated
to better clarify this.

/Thomas Lindroth

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-08-16 14:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-16 14:44 Is it normal for the user and sys times in /proc/stat to move backwards with NO_HZ? Thomas Lindroth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).