linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] Documentation/filesystems/proc.rst: Change the document about cputime
@ 2022-08-01 22:30 Li Hua
  0 siblings, 0 replies; only message in thread
From: Li Hua @ 2022-08-01 22:30 UTC (permalink / raw)
  To: akpm, mail, hannes, kaleshsingh, shy828301, rppt, paul.gortmaker
  Cc: linux-kernel, linux-fsdevel, linux-doc

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@huawei.com>
---
 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


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

only message in thread, other threads:[~2022-08-01  8:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-01 22:30 [PATCH -next] Documentation/filesystems/proc.rst: Change the document about cputime Li Hua

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).