RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 709684 - procps/top SWAP statistics makes no sense
Summary: procps/top SWAP statistics makes no sense
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: procps
Version: 6.2
Hardware: All
OS: Linux
low
medium
Target Milestone: rc
: ---
Assignee: Jaromír Cápík
QA Contact: BaseOS QE - Apps
URL:
Whiteboard:
Depends On: 532668
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-06-01 11:44 UTC by Jan Görig
Modified: 2019-07-11 07:32 UTC (History)
7 users (show)

Fixed In Version: procps-3.2.8-18.el6
Doc Type: Bug Fix
Doc Text:
Cause - per-process swap values was computed in procps incorrectly Consequence - per-process swap values in top make no sense Fix - swap values are now taken from /proc provided by kernel Result - per-process swap values in top are correct
Clone Of: 532668
Environment:
Last Closed: 2011-12-06 09:57:33 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
proposed patch (2.75 KB, patch)
2011-06-01 11:46 UTC, Jan Görig
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2011:1554 0 normal SHIPPED_LIVE procps bug fix update 2011-12-06 00:39:23 UTC

Description Jan Görig 2011-06-01 11:44:50 UTC
+++ This bug was initially created as a clone of Bug #532668 +++

Description of problem: top shows wrong values for the SWAP field of runnings processes.

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

How reproducible: always.

Steps to Reproduce: run top, press 'f', press 'p' (show SWAP column).
  
Actual results: senseless SWAP values for running processes.

Expected results: real SWAP values or disable SWAP column altogether as it makes no sense.

Additional info: consult with http://bugzilla.kernel.org/show_bug.cgi?id=14532 for more details.

--- Additional comment from triage.org on 2009-11-16 15:58:54 CET ---


This bug appears to have been reported against 'rawhide' during the Fedora 12 development cycle.
Changing version to '12'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

--- Additional comment from t.artem on 2009-11-16 16:24:44 CET ---

This is definitely `top` bug: http://bugzilla.kernel.org/show_bug.cgi?id=14532#c5

I have notified procps maintainer however I'm not sure if he fixes this bug in the nearest future, as procps development has stalled ostensibly.

--- Additional comment from fedora-admin-xmlrpc on 2010-05-20 14:30:19 CEST ---

This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

--- Additional comment from triage.org on 2010-11-04 07:50:52 CET ---


This message is a reminder that Fedora 12 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 12.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '12'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 12's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 12 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

--- Additional comment from t.artem on 2010-11-26 13:57:52 CET ---

Bump!

--- Additional comment from fedora-admin-xmlrpc on 2011-05-12 10:56:28 CEST ---

This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

--- Additional comment from t.artem on 2011-05-12 11:47:42 CEST ---

Created attachment 498494 [details]
top swap values with no swap

With SWAP disabled, it looks even funnier.

--- Additional comment from masanari_iida on 2011-05-25 11:47:51 CEST ---

Hello
There is one test patch for procps support swap field, created by Mr. Kosaki.
Can you test following patch and evaluate with kernel 2.6.34 or better?
https://github.com/kosaki/procps/commit/8a3d0d4e117efeec869d3d450f749a61cb8b0237

--- Additional comment from jgorig on 2011-05-26 14:43:32 CEST ---

Similar patch for readproc was added by upstream a year ago [1].
Fedora 15 has already this version of readproc but the top interface wasn't updated. I have done some little tests and output seems to be ok, so I am going to release update for F15 next week.

[1] https://gitorious.org/procps/procps/commit/5f570a84f186ca5924be0722ba0956d5fef0b04a

--- Additional comment from masanari_iida on 2011-05-26 17:08:39 CEST ---

Thanks for the investigation.
I will check the procps update on F15.
In the mean time, I would expect to see this modification on RHEL6.2,
because this feature is very useful for enterprise users.
if you ask me to open another BZ for RHEL6, let me know.

Comment 1 Jan Görig 2011-06-01 11:46:42 UTC
Created attachment 502228 [details]
proposed patch

Comment 3 masanari iida 2011-06-02 09:39:13 UTC
Patch on comment #1 works for me.

top - 00:26:06 up 1 day, 10:30,  7 users,  load average: 0.06, 0.01, 0.00
Tasks: 158 total,   1 running, 157 sleeping,   0 stopped,   0 zombie
Cpu(s):  0.3%us,  0.7%sy,  0.0%ni, 99.0%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:    758620k total,   653400k used,   105220k free,    48356k buffers
Swap:  2064376k total,     2620k used,  2061756k free,   236620k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  SWAP COMMAND
  490 root      16  -4 11384  856  392 S  0.0  0.1   0:00.19  580 udevd
 9694 root      18  -2 11380  716  240 S  0.0  0.1   0:00.01  564 udevd
 9693 root      18  -2 11380  724  240 S  0.0  0.1   0:00.00  556 udevd


[root@rhel6 ~]# cat /proc/490/status |grep VmSwap
VmSwap:      580 kB
[root@rhel6 ~]# cat /proc/9694/status |grep VmSwap
VmSwap:      564 kB
[root@rhel6 ~]# cat /proc/9693/status |grep VmSwap
VmSwap:      556 kB

Thank you!

Comment 5 Jan Görig 2011-06-02 12:35:33 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Cause
- per-process swap values was computed in procps incorrectly
Consequence
- per-process swap values in top make no sense
Fix
- swap values are now taken from /proc provided by kernel
Result
- per-process swap values in top are correct

Comment 6 masanari iida 2011-06-03 05:38:42 UTC
One minor request about man page.
Current man page of top(1),

> p: SWAP  -- Swapped size (kb)
-   The swapped out portion of a task's total virtual memory image.

+ Per-process swap values are now taken from /proc/#/status VmSwap field.

Comment 10 Wade Mealing 2011-07-08 05:55:10 UTC
Dumb post mistake, i just realised that other kernel structures may be swapped out.

Comment 12 errata-xmlrpc 2011-12-06 09:57:33 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2011-1554.html


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