[PATCH -next] Documentation/filesystems/proc.rst: Change the document about cputime

From: Li Hua
Date: Mon Aug 01 2022 - 04:34:34 EST


Because the values of utime, stime, and delta are temporarily
written to cpustat in kcpustat_cpu_fetch_vtime. Therefore, there are two
problems read from /proc/stat:
1. The value read the second time may be less than the first time.
2. When there are many tasks, the statistics are not imprecise when utime
and stime do not exceed one tick.

Signed-off-by: Li Hua <hucool.lihua@xxxxxxxxxx>
---
Documentation/filesystems/proc.rst | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/Documentation/filesystems/proc.rst b/Documentation/filesystems/proc.rst
index 47e95dbc820d..b6625e83c994 100644
--- a/Documentation/filesystems/proc.rst
+++ b/Documentation/filesystems/proc.rst
@@ -1459,6 +1459,10 @@ second). The meanings of the columns are as follows, from left to right:
- user: normal processes executing in user mode
- nice: niced processes executing in user mode
- system: processes executing in kernel mode
+ The amount of time reading from /proc/stat is not reliable, because the value
+ of utime, stime, and delta are temporarily written to cpustat in
+ kcpustat_cpu_fetch_vtime().
+
- idle: twiddling thumbs
- iowait: In a word, iowait stands for waiting for I/O to complete. But there
are several problems:
--
2.17.1