INTRODUCTION:
-------------
You can find in this directory the patches to enhance Linux kernel disk
accounting in order to get a true iostat command working.
Please note that it is NOT compulsory to apply a patch to the kernel for
iostat to work, but if you do so you will be able to monitor real I/O
transfer rate on a per-device basis. 

As it is the first version of the patch, I will NOT guarantee at all
it is working perfectly well. Anyway the patch is very simple by nature
and is unlikely to induce problems in the kernel.
Please tell me if you get weird things...


HOW DOES THE PATCH WORK ?
-------------------------
Just look in the diff file provided ;-)
Basically it adds two new fields in /proc/stat: 'disk_pgin' and 'disk_pgout'.
These fields contain the number of pages the system brought in and out for
the first four devices.
This is just like the 'page' field but this one gives the total number of
pages brought in and out without any distinction between the block devices.


HOW TO APPLY THE PATCH ?
------------------------
Suppose you have the 2.2.5-15 kernel sources installed in the /usr/src/linux
directory. So you want to apply the patch named "patch-2.2.5-15.gz".

Log in as root and copy the patch file into the /usr/src directory.
Then enter:

# cd /usr/src
# zcat patch-2.2.5-15.gz | patch -p1 -s -N -E -d /usr/src/linux

Recompile the kernel (see the README file in the kernel tree), reboot,
et voila!

Then you have to compile iostat with disk accounting: go into the sysstat
source tree, edit the Makefile and uncomment the following line by
removing the leading '#' sign:

#IOS_DFLAGS += -DHAS_DISK_ACCT

Compile with "make; make install" as usual.


PATCHES PROVIDED:
-----------------
The provided patches are:

* patch-2.2.5-15.gz: this is the patch against kernel 2.2.5-15 shipped with
the RedHat 6.0 distribution. Please note that this kernel from RedHat is not
a genuine "official" 2.2.5 kernel...
* patch-2.2.12.gz: patch against kernel 2.2.12 (latest kernel at this time).

If you are a bit of a hacker, you can _easily_ make one of these patches
suitable for another linux kernel...

Here is how I made the patch files:
/usr/src/linux-x.y.z contains the original kernel tree, and
/usr/src/linux the modified one.

# cd /usr/src
# diff -u --recursive --new-file linux-x.y.z linux >patch-x.y.z
# gzip -v9 patch-x.y.z

The patch currently touches the following kernel files:

linux/drivers/block/ll_rw_blk.c
linux/fs/proc/array.c
linux/include/linux/kernel_stat.h
linux/include/linux/blkdev.h

--
Sebastien Godard (sebastien.godard@wanadoo.fr)

