开发者

pgpgin and pgpgout - Linux Counters in /proc/vmstat

I am writing an application which collects overall system I/O stati开发者_运维知识库stics. 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!


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


See the Linux source code, for example at http://lxr.free-electrons.com/source/block/blk-core.c?v=4.6 . There we find that the counters are maintained in the submit_bio() function, which appears to count any disk i/o (see its uses at, for example, http://lxr.free-electrons.com/ident?v=4.6;i=submit_bio ), not to be confused with operating system paging (https://en.wikipedia.org/wiki/Paging).


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)


this maybe untimely, but I did a

man vmstat

and found that the file can be read, or there's a bin that can be called by the same name. This will give you all the same stuff but you can ask for it in different ways with the appropriate switch goodness. There's a small pile of descriptions for the various counters the bin reports on.

Hope it helps, Josh

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜