Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 478360 - sys-kernel/gentoo-sources : Idle time : Significant discrepancy between /proc/uptime and /proc/stat
Summary: sys-kernel/gentoo-sources : Idle time : Significant discrepancy between /proc...
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Linux bug wranglers
URL: https://patchwork.kernel.org/patch/46...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-07-27 14:16 UTC by Eric F. GARIOUD
Modified: 2013-07-29 09:38 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eric F. GARIOUD 2013-07-27 14:16:05 UTC
$ cat /proc/uptime;cat /proc/stat
15465.35 [28746.92]
cpu  115824 3797 71466 [2843077] 21523 3 2396 0 0 0

This taken as an immediate example.

There is a discrepancy between values of idle time as reported in /proc/uptime and /proc/uptime affecting all kernels I tested :

gentoo-sources-3.4.54 / 3.8.11 / 3.9.11

While "man proc" tells : "This value should be USER_HZ times the second entry in the /proc/uptime pseudo-file."
(USER_HZ=1/100th of a second  as reported by sysconf(_SC_CLK_TCK) on my arch)

The more the system is idle, the greater the discrepancy.

/proc/uptime appears to me as being incorrect because I, once, caught it > 2*uptime on a dual core system :

$ cat /proc/uptime 
 13743.06 [35517.30]

(Running CONFIG_NO_HZ=y) 


Reproducible: Always
Comment 1 Eric F. GARIOUD 2013-07-27 14:16:58 UTC
Portage 2.1.12.2 (default/linux/amd64/13.0, gcc-4.6.3, glibc-2.15-r3, 3.4.54-gentoo.1 x86_64)
=================================================================
System uname: Linux-3.4.54-gentoo.1-x86_64-Intel-R-_Core-TM-2_Duo_CPU_E8400_@_3.00GHz-with-gentoo-2.2
KiB Mem:     4049368 total,   1878212 free
KiB Swap:          0 total,         0 free
Timestamp of tree: Thu, 25 Jul 2013 07:15:01 +0000
ld GNU ld (GNU Binutils) 2.23.1
app-shells/bash:          4.2_p45
dev-java/java-config:     2.1.12-r1
dev-lang/python:          2.7.5
dev-util/cmake:           2.8.10.2-r2
dev-util/pkgconfig:       0.28
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.11.8
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.11.6, 1.12.6
sys-devel/binutils:       2.23.1
sys-devel/gcc:            4.6.3
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4-r1
sys-devel/make:           3.82-r4
sys-kernel/linux-headers: 3.7 (virtual/os-headers)
sys-libs/glibc:           2.15-r3
Repositories: gentoo PrimaPratica_ovl
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/themes/oxygen-gtk/gtk-2.0 /usr/share/themes/oxygen-gtk/gtk-3.0 /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=native -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--color y --alphabetical --autounmask=n"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org/ "
LANG="fr_FR.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_EXTRA_OPTS="--exclude-from=/PrimaPratica/MySysConf/portage.exclude"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/var/portages/G_Portage"
PORTDIR_OVERLAY="/var/portages/PP_Portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="24bpp X accessibility alsa amd64 amr atm bzip2 caps cdda cdio cli consolekit cracklib crypt css cups custom-cflags custom-optimization cxx dbus dga dts enca exceptions exif faac flac fontconfig fontforge fortran glib glpk gsm handbook hardcoded-tables iconv icu id3tag idn inotify introspection ipc jack jit kipi kontact lcms libass libnotify libsamplerate mmx mmxext mng modplug modules mudflap multilib natspec ncurses nls nptl ocamlopt openal opencl openexr opengl openmp orc pam pch plasma policykit private-headers pth qt-faststart qt3support readline schroedinger semantic-desktop session smp speex sse sse2 sse3 sse4_1 ssl ssse3 startup-notification system-sqlite taglib tcpd threads twolame udev unicode uuid vaapi vdpau vim-syntax vpx wallpapers wavpack xattr xcb xv xvmc zlib" ABI_X86="64" ALSA_CARDS="hda-intel ice1712" CAMERAS="ptp2" CURL_SSL="openssl" ELIBC="glibc" FFTOOLS="cws2fws" INPUT_DEVICES="evdev" KERNEL="linux" LIBREOFFICE_EXTENSIONS="nlpsolver pdfimport presenter-console presenter-minimizer scripting-javascript" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-4" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="nvidia"
USE_PYTHON="2.7"
Unset:  CPPFLAGS, CTARGET, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS
Comment 2 Jeroen Roovers (RETIRED) gentoo-dev 2013-07-29 09:37:01 UTC
It's been known for a while now (and the patch in the URL isn't quite the solution).