Bug 185609 - kernel returned wrong value in /proc/stat when value is greater than 2^32
kernel returned wrong value in /proc/stat when value is greater than 2^32
Status: CLOSED WONTFIX
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: kernel (Show other bugs)
3.0
ia64 Linux
medium Severity medium
: ---
: ---
Assigned To: Brian Maly
Brian Brock
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-03-16 03:17 EST by Petr Sretr
Modified: 2007-11-30 17:07 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-04-27 15:32:21 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Petr Sretr 2006-03-16 03:17:46 EST
kernel returned wrong value in /proc/stat
when value is greater than 2^32

there is /proc/stat from my server ( HP rx4640 )

cat /proc/stat
cpu  2341684997 60902 286835084   67683455 21342783 9442787 53367290
cpu0 1133888982 25744 143027669 2238305424 10544857 0       11899664
cpu1 1207796015 35158 143807415 2124345327 10797926 9442787 41467626


as you can see in Idle CPU column is wrong value there is number
67683455 but should be 2238305424+2124345327=4362650751

How reproducible:

cat /proc/stat on server which run enough time 

Steps to Reproduce:
1. cat /proc/stat
2.
3.
  
Actual results:

cat /proc/stat
cpu  2341684997 60902 286835084   67683455 21342783 9442787 53367290
cpu0 1133888982 25744 143027669 2238305424 10544857 0       11899664
cpu1 1207796015 35158 143807415 2124345327 10797926 9442787 41467626


Expected results:

cat /proc/stat
cpu  2341684997 60902 286835084 4362650751 21342783 9442787 53367290
cpu0 1133888982 25744 143027669 2238305424 10544857 0       11899664
cpu1 1207796015 35158 143807415 2124345327 10797926 9442787 41467626


Additional info:
Comment 1 Ernie Petrides 2006-03-16 16:03:47 EST
The problem is in kstat_read_proc() - the associated statistics totals
are kept in "unsigned int" variables.  This has been addressed in RHEL4
by making the values u64's in show_stat().  Obviously, the printk()
formats would need to be changed as well.  Note that the per-cpu values
should use %lu, because kernel_timeval_to_clock_t() returns an "unsigned
long".

Note You need to log in before you can comment on or make changes to this bug.