On 8/16/2012 4:50 PM, Miquel van Smoorenburg wrote:I did a simple test:
* created a 1G partition on 3 seperate disks
* created a md raid5 array with 512K chunksize:
mdadm -C /dev/md0 -l 5 -c $((1024*512)) -n 3 /dev/sdb1 /dev/sdc1
/dev/sdd1
* ran disk monitoring using 'iostat -k 5 /dev/sdb1 /dev/sdc1 /dev/sdd1'
* wrote a single 4K block:
dd if=/dev/zero bs=4K count=1 oflag=direct seek=30 of=/dev/md0
Output from iostat over the period in which the 4K write was done. Look
at kB read and kB written:
Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
sdb1 0.60 0.00 1.60 0 8
sdc1 0.60 0.80 0.80 4 4
sdd1 0.60 0.00 1.60 0 8
As you can see, a single 4K read, and a few writes. You see a few blocks
more written that you'd expect because the superblock is updated too.
I'm no dd expert, but this looks like you're simply writing a 4KB block
to a new stripe, using an offset, but not to an existing stripe, as the
array is in a virgin state. So it doesn't appear this test is going to
trigger RMW. Don't you need now need to do another write in the same
stripe to to trigger RMW? Maybe I'm just reading this wrong.