iostat source of information

Steve Harvey sgh-Ja3L+HSX0kI at public.gmane.org
Mon Mar 23 20:48:59 UTC 2009


On Sat, Mar 21, 2009 at 11:02:19PM -0400, William Muriithi wrote:
> Hi
> 
> I am wondering, is iostat performance statistics influenced in any
> manner by the lvm or filesystem or are they extracted from interaction
> between the hard disk and operating system via the device drivers? I
> have noticed something, if I run iostat, it does detect the device
> instead of the volume. That made me suspect that these statistics are
> for a device level performance. So, I undertook a bit of googling but
> can not see an article that explicitly state that.

  iostat reports separately for base block devices and partitions as
well as LVM and software RAID that use the device mapper, so you should 
be seeing all of them.

If you sum the Blk_read and Blk_wrtn counters for your dm-N disks, they
should approximate the counters for their base partition/device.  They
may differ due to request merging.

> 
> Anyway, I then decided to throw it here just in case one of us may be
> in the know of where iostat read from. I have looked at the iostat
> code and it content are from the proc file. But where the operating
> system collect this information from elude me.
> 

Using cscope with recent kernels lets you find interesting 
stuff (here looking at 2.6.28), such as:

The data for /proc/diskstats is generated by diskstats_show()
in block/genhd.c, and that for /sys/block/<device>/stat by
part_stat_show() in fs/partitions/check.c .  The counters themselves
are updated in 

block/blk-core.c: part_round_stats_single()  time_in_queue, io_ticks
block/blk-core.c: drive_stat_acct()          merges
drivers/block/aoe/aoecmd.c: diskstats()      ios, ticks, sectors, io_ticks
drivers/md/dm.c: start_io_acct()/end_io_acct()  in_flight
include/linux/genhd.h: part_inc_in_flight/part_dec_in_flight

and documented in  Documentation/block/stat.txt .

-sgh
--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists





More information about the Legacy mailing list