Bug 1118274

Summary: /proc/pid/stat utime & guest_time do not match
Product: [Fedora] Fedora Reporter: Markus Stockhausen <mst>
Component: kernelAssignee: Kernel Maintainer List <kernel-maint>
Status: CLOSED UPSTREAM QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 20CC: gansalmon, itamar, jonathan, kernel-maint, madhu.chinakonda, mchehab
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-07-10 11:57:54 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Markus Stockhausen 2014-07-10 10:42:43 UTC
Description of problem:

qemu process values of utime and guest_time in /proc/pid/stat do not match. According to "man proc":

utime %lu   (14) Amount of time that this process has been
  scheduled in user mode, measured in clock ticks
  (divide by sysconf(_SC_CLK_TCK)).  This includes
  guest time, guest_time (time spent running a
  virtual CPU, see below), so that applications that
  are not aware of the guest time field do not lose
  that time from their calculations.

guest_time %lu (since Linux 2.6.24)
  (43) Guest time of the process (time spent running
  a virtual CPU for a guest operating system),
  measured in clock ticks (divide by
  sysconf(_SC_CLK_TCK)).

Thus increasing values in field 43 (guest_time) should also show up as increasing values in field 14 (utime).


Version-Release number of selected component (if applicable):

Fedora 20
Kernel 3.14.7-200.fc20.x86_64

How reproducible:

unknown. A the moment one process affected

Steps to Reproduce:

1. Determine qemu PID

ps -e | grep qemu
  306 ?        3-07:37:18 qemu-system-x86
 8299 ?        1-04:56:39 qemu-system-x86
14444 ?        1-04:58:41 qemu-system-x86
17618 ?        1-14:30:31 qemu-system-x86
19532 ?        1-11:02:46 qemu-system-x86
21794 ?        1-08:51:17 qemu-system-x86
32508 ?        7-14:57:01 qemu-system-x86

2. show /proc/pid/stat values requlary

cat /proc/32508/stat | awk '{ print $14 " " $43 }'
55580419 13134692
cat /proc/32508/stat | awk '{ print $14 " " $43 }'
55580419 13134717
cat /proc/32508/stat | awk '{ print $14 " " $43 }'
55580419 13134726
cat /proc/32508/stat | awk '{ print $14 " " $43 }'
55580419 13134738

Actual results:

As you can see field 14 does not get any updates although field 43 increases.

Expected results:

Field 14 (utime) should be increased too

Comment 1 Josh Boyer 2014-07-10 11:57:54 UTC
Please report this to the upstream kernel maintainers.  This is a low priority issue and we aren't going to have time to get to it.