Bug 239654 - Enhancement/backport: Expose I/O accounting stats in /proc
Enhancement/backport: Expose I/O accounting stats in /proc
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: kernel (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: RHEL Product and Program Management
Red Hat Kernel QE team
: FutureFeature
Depends On:
  Show dependency treegraph
Reported: 2007-05-10 06:25 EDT by Kenn Humborg
Modified: 2012-10-25 03:02 EDT (History)
16 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2012-10-25 03:02:05 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Kenn Humborg 2007-05-10 06:25:33 EDT
Description of problem:

Total bytes read/written and number of read/write syscalls are
maintained in task_struct (rchar, wchar, syscr, syscw fields).

However, these are not exposed to userspace.

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


How reproducible:


Steps to Reproduce:
1. cd /proc/self
2. ls
Actual results:

No file called "io"

Expected results:

A file called "io" with contents like:

rchar: 59719
wchar: 47113
syscr: 982
syscw: 434

Additional info:

This is achievable with a back-port of this patch:


The reason I am looking for this is to help me identify which processes
are generating I/O load.
Comment 1 Bill McGonigle 2009-04-22 17:36:37 EDT
This link may also be helpful:


It seems to list the patches required for 2.6.20-style IO accounting.

This is needed to get e.g. iotop running on RHEL, so admins can see who's eating their disks.

I'm not sure about the timing of 2.6.20 vs. Kenn's request, but this may be the preferred implementation at this point, to get us through until RHEL6.
Comment 2 Eric Gearhart 2009-09-08 03:09:57 EDT
To get iotop running on RHEL, in addition to the kernel /proc backports we'd need to either update python to 2.5 (probably not going to happen in RHEL 5) or somehow we figure out why iotop specifically needs python to be >= 2.5, right?

It'd be great if iotop was backported to RHEL 5! I really miss it (I was running Debian in the past and used it extensively)
Comment 3 Greg Swift 2009-09-08 12:50:36 EDT
The RHEL5.4 release states the following:

Blktrace – block IO layer tracing mechanism – providing info on request
queue operations

I/O accounting – per-process I/O accounting data /proc/<pid>/io – not
impacted by cached data, also added to iostat

So does that mean this bug got handled?
Comment 4 Antonello Piemonte 2009-09-24 07:40:53 EDT
seems indeed available in 5.4

# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 5.4 (Tikanga)
# cat /proc/8882/io
rchar: 1179045
wchar: 10619
syscr: 40646
syscw: 123
read_bytes: 360448
write_bytes: 45056
cancelled_write_bytes: 0
Comment 5 Matt Dainty 2010-02-01 11:59:23 EST
Although the statistics do appear to be added and available through the /proc filesystem, iotop at least still won't work as it seems the netlink taskstats interface hasn't also been updated. Poking around /usr/include/linux/taskstats.h doesn't show the extra fields.

Incidentally, getting iotop to work is straightforward without needing to upgrade python, I just installed the python-ctypes package available in EPEL, (the homepage for iotop mentions this).
Comment 6 Georgi Hristov 2010-02-21 21:26:58 EST
So, did IOTOP work for you with RHEL5.4 and Pytohon 2.4 + python-ctypes ? Or does it still need some kernel stats not exposed yet?
Comment 7 Georgi Hristov 2010-02-21 21:54:35 EST
I just wanted to come back and note that IOTOP did not work on mine RHEL5.4 and Pytohon 2.4 + python-ctypes system.  I got an error that "CONFIG_TASK_DELAY_ACCT not enabled in kernel". I do have /proc/<pid>/io properly exposed.

BTW, IOTOP rpm did not properly install (download from freshmeat.net). After rebuilding the source RPM, it installed with no problems.
Comment 8 Gianluca Cecchi 2010-02-23 03:11:34 EST
should this message give a solution?

Did you try iotop-0.4 too?
Comment 9 Greg Swift 2010-02-23 09:30:35 EST
I tried building the fedora 0.4-1 version on RHEL 5.  Was able to build the RPM but I get the same error when executing iotop.

CONFIG_TASK_DELAY_ACCT not enabled in kernel, cannot determine SWAPIN and IO %
Comment 10 Matt Dainty 2010-02-23 10:06:21 EST
From reading the source, iotop doesn't use the /proc filesystem to gather I/O statistics apart from checking the existence of /proc/self/io as a crude test to see if the kernel has the necessary support enabled.

iotop uses the netlink taskstats interface to gather I/O statistics and from what I can tell, the changes to that interface have not been backported to the RHEL 5 kernel. There may be a reason as to why, it could break something else.

Compare /usr/include/linux/taskstats.h from the kernel-headers package between RHEL and Fedora for example, you'll see the extra I/O counters in the Fedora version.
Comment 11 Bill McGonigle 2010-02-23 11:53:35 EST
This looks like the commit:


>CONFIG_TASK_DELAY_ACCT not enabled in kernel, cannot determine SWAPIN and IO 

It looks like it is enabled:

but the new requirements say:

 # Check for requirements:
-#   o Python >= 2.5 for AF_NETLINK sockets
 #   o Linux >= 2.6.20 with I/O accounting

and RHEL has 2.6.18, so there must be some delta to 2.6.20 that's still needed.

The initial comment on this bug wasn't iotop specific, but if that's the ultimate goal, the summary/request should be updated, or a new bug posted.  Kenn, your call I think.
Comment 12 Gianluca Cecchi 2010-02-23 14:19:03 EST
There are:
1) https://bugzilla.redhat.com/show_bug.cgi?id=546266
with python-ctypes inclusion that now is an option for iotop upstream use if you have python 2.4 such as in rh el 5
(see also home page at http://guichaz.free.fr/iotop/)

2) https://bugzilla.redhat.com/show_bug.cgi?id=557062
 Review Request: iotop - Top like utility for I/O  

That seems to be targeted to 5.6.... any hope for 5.5 inclusion that is now in beta?
From this bug it seems there are not quite serious BAD things right now...

Many users are waiting for one utility such as iotop and I think it could be a nice thing to be put into release notes for 5.5.

There are also systemtap+scripts to accomodate similar results, but probably iotop would be better and easier to use.

See also older EPEL bugzilla entry https://bugzilla.redhat.com/show_bug.cgi?id=465795

Thanks in advance for attention
Comment 13 Kenn Humborg 2010-02-24 13:04:14 EST
The particular problem I was trying track down is no longer an
issue, so I don't have any strong feelings on this anymore.

Certainly, iotop looks like a very useful tool and probably would have
helped me a lot back then, so I'd agree with re-casting this bug 
as a request to get iotop working.

In addition, I don't have a machine running 5.4 that I can play with
right now, so I can't help out much with testing iotop, so I'll leave 
it up to you guys whether you want to change this bug's summary or 
create a new one.

Thanks all!
Comment 14 Eric Gearhart 2010-02-24 14:44:04 EST
(In reply to comment #13)
> I'll leave 
> it up to you guys whether you want to change this bug's summary or 
> create a new one.

I very much would like to see iotop make it into RHEL... should create a new feature request asking specifically for iotop? I can and will if that's the best path.

Letting this ticket "roll over" to being an iotop request would be OK with me as well

Comment 15 Gianluca Cecchi 2010-02-24 16:51:58 EST
As I wrote in comment #12, there is already a bug open for iotop inclusion as a review request: it is number 557062.
So I propose to close this bug as its subject has been solved with rh el 5.4 release; and being this a requirement, I'm proposing to stress change of target version for 557062 solution into 5.5.
Let the ones here sponsoring iotop inclusion go and add their comments to 
https://bugzilla.redhat.com/show_bug.cgi?id=557062 too
Comment 20 RHEL Product and Program Management 2012-10-10 07:50:42 EDT
Thank you for submitting this issue for consideration. Red Hat Enterprise Linux 5 has reached the end of Production 1 Phase of its Life Cycle.  Red Hat does not plan to incorporate the suggested capability in a future Red Hat Enterprise Linux 5 minor release. If you would like Red  Hat to re-consider this feature request and the requested functionality is not currently in Red Hat Enterprise Linux 6, please re-open the request via appropriate support channels and provide additional supporting details about the importance of this issue.

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