Bug 1118274 - /proc/pid/stat utime & guest_time do not match
Summary: /proc/pid/stat utime & guest_time do not match
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: kernel
Version: 20
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Kernel Maintainer List
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-07-10 10:42 UTC by Markus Stockhausen
Modified: 2014-07-10 11:57 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-07-10 11:57:54 UTC


Attachments (Terms of Use)

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.


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