[PATCH 7/7] docs: proc.rst: stat: Note the interrupt counter wrap-around

From: Alexei Lozovsky
Date: Fri Sep 10 2021 - 23:49:27 EST


Let's make wrap-around documented behavior so that userspace has no
excuses for not handling it properly if they want accurate values.

Both "intr" and "softirq" counters (as well as many others, actually)
can and will wrap-around, given enough time since boot.

Signed-off-by: Alexei Lozovsky <me@xxxxxxxxxx>
---
Documentation/filesystems/proc.rst | 7 +++++++
1 file changed, 7 insertions(+)

diff --git a/Documentation/filesystems/proc.rst b/Documentation/filesystems/proc.rst
index 042c418f4090..06a0e3aa2e0e 100644
--- a/Documentation/filesystems/proc.rst
+++ b/Documentation/filesystems/proc.rst
@@ -1513,6 +1513,13 @@ interrupts serviced including unnumbered architecture specific interrupts;
each subsequent column is the total for that particular numbered interrupt.
Unnumbered interrupts are not shown, only summed into the total.

+.. note::
+
+ Interrupt counters on most platforms are 32-bit, including the total count.
+ Depending on the system load, ths values will sooner or later wrap around.
+ If you want accurate accouting of the rate and *real* number of interrupts
+ serviced, you should monitor the value closely and handle wrap-arounds.
+
The "ctxt" line gives the total number of context switches across all CPUs.

The "btime" line gives the time at which the system booted, in seconds since
--
2.25.1