How can the 2nd field (idle time) of /proc/uptime be greater than overall system uptime?

Solution Verified - Updated -

Environment

  • Red Hat Enterprise Linux 6

Issue

  • The RHEL Deployment Guide states the following about /proc/uptime:
    • "The first number is the total number of seconds the system has been up.  The second number is how much of that time the machine has spent idle,  in seconds".
  • I have systems where the 2nd number is greater than the first.  How is this possible ?

    # cat /etc/redhat-release
    Red Hat Enterprise Linux Server release 6.1 (Santiago)
    
    # uname -a
    Linux hostname 2.6.32-131.0.15.el6.x86_64 #1 SMP Tue May 10 15:42:40 EDT 2011 x86_64 x86_64 x86_64 GNU/Linux
    
    # cat /proc/uptime 
    347280.24 8331386.33
    

Resolution

  • On multi core systems the second number is the sum of the idle time accumulated by each CPU.  So, if a quad-core CPU is entirely idle for 1 second, it will count as 4 seconds.
  • The 2nd number is a sum of idle time across _all_ cores, and thus may be greater than overall system uptime.
  • BZ737030 has been filed to clarify the documentation.

  • A uni-processor VM:

    # cat /proc/uptime 
    54554.02 54384.46
    
  • A 2-vCPU VM:

    # cat /proc/uptime
    54574.45 108962.71
    
  • A 4-core physical machine (single socket)

    # cat /proc/uptime
    4831626.61 17596278.74
    
  • An 8-core physical machine (dual-socket)

    # cat /proc/uptime
    59377.60 467498.28
    

Root Cause

  • You can find LKML discussion at:  https://lkml.org/lkml/2009/9/10/185

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.