Skip to contentSkip to conversation

/proc/partitions statistics question

DISCUSSION Jean-Luc Fontaine 2 participants 2 messages Dec 16, 2003

lore
Share & tools
lore
#0 lore raw

I have been trying to make sense of the units used in the /proc/partitions statistics.
I thought read and write I/O were in kilobytes, but not according to the following test on my 2.4.3 kernel machine:

# /proc/partitions columns:
# major minor #blocks name rio rmerge rsect ruse wio wmerge wsect wuse running use aveq
$ fgrep hdb1 /proc/partitions
$ dd if=/dev/zero of=ttt bs=1M count=1024 2>/dev/null
$ sync; sync; sync
$ fgrep hdb1 /proc/partitions
   3    65   40209088 hdb1 7107 18180 202278 384530 7925 19005 215616 
215330 0 46240 599860
   3    65   40209088 hdb1 7134 18218 202798 386510 24566 265384 
2319776 2977060 0 102000 3363570
$ ls -lk ttt
-rw-r--r--    1 root     root      1048576 Dec 13 15:56 ttt
$ fgrep hdb1 /proc/partitions
$ dd if=ttt of=/dev/null 2>/dev/null
$ sync; sync; sync
$ fgrep hdb1 /proc/partitions
   3    65   40209088 hdb1 7152 18222 202974 386650 24581 265397 
2320000 2977060 0 102140 3363710
   3    65   40209088 hdb1 23567 263977 2300334 555980 24668 265441 
2321048 2978280 0 171380 3534260

(24566 - 7925) = 16641 were written, whereas (23567 - 7152) = 16415 were read
I would have expected something near 1048576 (kilobytes), but the results seem to be roughly 64 times less...

I would really appreciate an explanation, as I use those statistics in a monitoring program and for filesystems performance tests.

Many thanks for your help!

Signature · 1 line
Jean-Luc Fontaine  mailto:[email protected]  http://jfontain.free.fr/
#1 lore raw
Quoted 10 lines · Jean-Luc Fontaine

(24566 - 7925) = 16641 were written, whereas (23567 - 7152) = 16415 were read
I would have expected something near 1048576 (kilobytes), but the results seem to be roughly 64 times less...

I would really appreciate an explanation, as I use those statistics in a monitoring program and for filesystems performance tests.

Many thanks for your help!

check out the man page for iostat in the sar/sysstat package. It documents
what is happening here. This is in blocks, and there is merging to
consider and etc...

Quoted 8 lines
Signature · 6 lines
Jean-Luc Fontaine  mailto:[email protected]  http://jfontain.free.fr/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/