views:

418

answers:

2

Hi,

I am writing an application which collects overall system I/O statistics. I was wondering whether the two counters for page-ins and page-outs,

pgpgin
pgpgout

in /proc/vmstat include pages written to, and read from all disk-based block devices attached to the system.

Please let me know, if you can!

A: 

I wouldn't see why not. I mean, when you get a pagefault the needed blocks can come from anywhere depending on which filesystems are mounted where in the VFS (i.e. memory mapped i/o) or swapped out process space to swap filesystems/files. I don't see why not all blockdevices would be counted, because all them could be used for paging (but that depends on what filesystems you have on them and how you use them)

Dieter_be
+1  A: 

The pages are written to and from the swap partitions; the numbers do not tell you which partition they were written to, only that a paging event occurred.

If you want to look at disk IO statistics, you should look at /proc/diskstats or /sys/block/*/stat for the block device IO counters.

This article on vmstat is helpful to understand what the paging counters mean: http://www.linuxjournal.com/article/8178

jaq