linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stan Hoeppner <stan@hardwarefreak.com>
To: Miquel van Smoorenburg <mikevs@xs4all.net>
Cc: Linux RAID <linux-raid@vger.kernel.org>
Subject: Re: O_DIRECT to md raid 6 is slow
Date: Sat, 18 Aug 2012 00:09:17 -0500	[thread overview]
Message-ID: <502F237D.6060806@hardwarefreak.com> (raw)
In-Reply-To: <502E2817.8040306@xs4all.net>

On 8/17/2012 6:16 AM, Miquel van Smoorenburg wrote:
> On 08/17/2012 09:31 AM, Stan Hoeppner wrote:
>> 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.
> 
> That shouldn't matter, but that is easily checked ofcourse, by writing
> some random random data first, then doing the dd 4K write also with
> random data somewhere in the same area:
> 
> # dd if=/dev/urandom bs=1M count=3 of=/dev/md0
> 3+0 records in
> 3+0 records out
> 3145728 bytes (3.1 MB) copied, 0.794494 s, 4.0 MB/s
> 
> Now the first 6 chunks are filled with random data, let write 4K
> somewhere in there:
> 
> # dd if=/dev/urandom bs=4k count=1 seek=25 of=/dev/md0
> 1+0 records in
> 1+0 records out
> 4096 bytes (4.1 kB) copied, 0.10149 s, 40.4 kB/s
> 
> Output from iostat over the period in which the 4K write was done:
> 
> 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

According to your iostat output, the IO is identical for both tests.  So
either you triggered an RMW in the first test, or you haven't triggered
an RMW with either test.  Your fist test shouldn't have triggered RMW.
The second one should have.

BTW, I'm curious why you replied to my message posted to linux-raid,
then stripped linux-raid from the CC list and added lkml proper.  What
was the reason for this?  I'm adding linux-raid and removing lkml.

-- 
Stan


  parent reply	other threads:[~2012-08-18  5:09 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-15  0:49 O_DIRECT to md raid 6 is slow Andy Lutomirski
2012-08-15  1:07 ` kedacomkernel
2012-08-15  1:12   ` Andy Lutomirski
2012-08-15  1:23     ` kedacomkernel
2012-08-15 11:50 ` John Robinson
2012-08-15 17:57   ` Andy Lutomirski
2012-08-15 22:00     ` Stan Hoeppner
2012-08-15 22:10       ` Andy Lutomirski
2012-08-15 23:50         ` Stan Hoeppner
2012-08-16  1:08           ` Andy Lutomirski
2012-08-16  6:41           ` Roman Mamedov
     [not found]     ` <201208152307.q7FN7hMR008630@xs8.xs4all.nl>
     [not found]       ` <502CD3F8.70001@hardwarefreak.com>
     [not found]         ` <502D6B0A.6090508@xs4all.net>
     [not found]           ` <502DF357.8090205@hardwarefreak.com>
     [not found]             ` <502E2817.8040306@xs4all.net>
2012-08-18  5:09               ` Stan Hoeppner [this message]
2012-08-18 10:08                 ` Michael Tokarev
2012-08-19  3:17                   ` Stan Hoeppner
2012-08-19 14:01                     ` David Brown
2012-08-19 23:34                       ` Stan Hoeppner
2012-08-20  0:01                         ` NeilBrown
2012-08-20  4:44                           ` Stan Hoeppner
2012-08-20  5:19                             ` Dave Chinner
2012-08-20  5:42                               ` Stan Hoeppner
2012-08-20  7:47                           ` David Brown
2012-08-21 14:51                         ` Miquel van Smoorenburg
2012-08-22  3:59                           ` Stan Hoeppner
2012-08-19 17:02                     ` Chris Murphy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=502F237D.6060806@hardwarefreak.com \
    --to=stan@hardwarefreak.com \
    --cc=linux-raid@vger.kernel.org \
    --cc=mikevs@xs4all.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).