diff options
author | Josh Don <[email protected]> | 2021-08-27 09:54:38 -0700 |
---|---|---|
committer | Peter Zijlstra <[email protected]> | 2021-10-05 15:51:35 +0200 |
commit | a130e8fbc7de796eb6e680724d87f4737a26d0ac (patch) | |
tree | 4adeb41642500b6aca5ddd2b1144a9785e2e591e /scripts/gdb/linux/proc.py | |
parent | bc9ffef31bf59819c9fc032178534ff9ed7c4981 (diff) |
fs/proc/uptime.c: Fix idle time reporting in /proc/uptime
/proc/uptime reports idle time by reading the CPUTIME_IDLE field from
the per-cpu kcpustats. However, on NO_HZ systems, idle time is not
continually updated on idle cpus, leading this value to appear
incorrectly small.
/proc/stat performs an accounting update when reading idle time; we
can use the same approach for uptime.
With this patch, /proc/stat and /proc/uptime now agree on idle time.
Additionally, the following shows idle time tick up consistently on an
idle machine:
(while true; do cat /proc/uptime; sleep 1; done) | awk '{print $2-prev; prev=$2}'
Reported-by: Luigi Rizzo <[email protected]>
Signed-off-by: Josh Don <[email protected]>
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Reviewed-by: Eric Dumazet <[email protected]>
Link: https://lkml.kernel.org/r/[email protected]
Diffstat (limited to 'scripts/gdb/linux/proc.py')
0 files changed, 0 insertions, 0 deletions