Bug 253337

Summary: AIO not shown by iostat, top, etc.
Product: Red Hat Enterprise Linux 5 Reporter: Jeff Moyer <jmoyer>
Component: kernelAssignee: Jeff Moyer <jmoyer>
Status: CLOSED ERRATA QA Contact: Martin Jenner <mjenner>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.0   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: RHBA-2008-0314 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-05-21 14:52:31 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 425461    
Attachments:
Description Flags
use io_schedule in the AIO code
none
Only account io_wait time if waiting for events none

Description Jeff Moyer 2007-08-17 22:12:48 UTC
+++ This bug was initially created as a clone of Bug #220902 +++

Summary:  AIO calls in the kernel do not get registered by iostat, top and
similar programs as contributing to iowait.  

Details:  When the aio kernel module reads or writes, it doesn't schedule the
I/O in a way that gets recognized by our sysstat programs.  That leads to a
situation where inaccurate outputs of iowait.  The customer's onsite GPS
consultant observed this behavior and proposed the aio.patch file that's
attached to this IT ticket.  It was submitted to rhkernel-list and lkml where it
was rejected by lkml.

-- Additional comment from jmoyer on 2007-08-17 12:25 EST --
Created an attachment (id=161753)
Account for io_wait time properly when using AIO

In theory, not all AIO operations actually initiate disk I/O.  The only AIO
command that does not issue disk I/O is IOCB_CMD_NOOP which, as it happens,
actually isn't usable as implemented!

If IOCB_CMD_NOOP were usable, the attached patch would be the right way to
account for I/O wait time appropriately.  It creates a hash table of io
contexts and associated I/O counters.  Whenever a process schedules, this code
checks to see if there is real I/O pending, and calls io_schedule if so. 
Otherwise, it uses schedule() as before.

Given that IOCB_CMD_NOOP doesn't actually work, the real solution is to just
call io_schedule unconditionally.  That patch is much simpler, and I'll attach
it after discussing this with upstream.

I'm posting this patch in case we ever wanted to correctly implement the
IOCB_CMD_NOOP command.

Comment 1 Jeff Moyer 2007-08-17 22:23:40 UTC
Created attachment 161774 [details]
use io_schedule in the AIO code

Comment 2 RHEL Program Management 2007-08-17 22:26:01 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.

Comment 4 Don Zickus 2007-11-29 17:04:56 UTC
in 2.6.18-58.el5
You can download this test kernel from http://people.redhat.com/dzickus/el5

Comment 5 Jeff Moyer 2007-12-18 18:17:07 UTC
Created attachment 289911 [details]
Only account io_wait time if waiting for events

This patch needs to be applied in addition to the previous one.  Upstream
discussion here:
  http://www.mail-archive.com/linux-kernel@vger.kernel.org/msg236279.html

Comment 7 Don Zickus 2008-01-10 20:42:25 UTC
in 2.6.18-66.el5
You can download this test kernel from http://people.redhat.com/dzickus/el5

Comment 10 errata-xmlrpc 2008-05-21 14:52:31 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2008-0314.html