This service will be undergoing maintenance at 00:00 UTC, 2016-09-28. It is expected to last about 1 hours
Bug 125305 - thread CPU usage is double-counted in per-process stats
thread CPU usage is double-counted in per-process stats
Status: CLOSED WONTFIX
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: kernel (Show other bugs)
3.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Ingo Molnar
Brian Brock
:
Depends On:
Blocks: 133089
  Show dependency treegraph
 
Reported: 2004-06-04 12:16 EDT by Lev Makhlis
Modified: 2007-11-30 17:07 EST (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-09-15 13:35:41 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
Test program (rhel3_bug.c) (233 bytes, text/plain)
2004-06-04 12:18 EDT, Lev Makhlis
no flags Details

  None (edit)
Description Lev Makhlis 2004-06-04 12:16:47 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040510

Description of problem:
In a multithreaded process, the CPU usage of non-leader threads is
counted twice: while the thread is running, its usage is tracked in
group_[us]time, and after it terminates, is also added to
group_c[us]time.  I believe this is a bug in release_task() in
kernel/exit.c: p->parent->group_leader->group_c[us]time shouldn't be
updated if p->parent->group_leader == p->group_leader.

Version-Release number of selected component (if applicable):
kernel-2.4.21-15.EL

How reproducible:
Always

Steps to Reproduce:
1. See attached rhel3_bug.c.
2. cc rhel3_bug.c -lpthread -o rhel3_bug
3. ./rhel3_bug&
4. ps -p $!
5. ps -S -p $!
6. cat /proc/${!}/stat
    

Actual Results:  3.
[1] 19892
Ready

4.
  PID TTY          TIME CMD
19892 pts/0    00:00:06 rhel3_bug

5.
  PID TTY      STAT   TIME COMMAND
19892 pts/0    S      0:13 ./rhel3_bug

6.
19892 (rhel3_bug) S 7502 19892 7481 34816 19900 0 30 0 98 1 0 0 656 0
15 0 0 0 9512205 12087296 97 4294967295 134512640 134514124 3221214288
3221214136 3076439090 0 0 0 0 3222500403 0 0 17 0 0 0 656 0 656 0

Expected Results:  ps -S should have reported 6.5 seconds

Additional info:
Comment 1 Lev Makhlis 2004-06-04 12:18:07 EDT
Created attachment 100872 [details]
Test program (rhel3_bug.c)
Comment 5 Ernie Petrides 2005-09-15 16:14:24 EDT
This problem has been resolved in RHEL4.  However, back-porting the fixes
to RHEL3 is not feasible because of the required changes to key data
structures that would break kernel module compatibility (kABI).

Thus, I'm closing this as WONTFIX for RHEL3.

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