linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: majianpeng <majianpeng@gmail.com>
To: Neil Brown <neilb@suse.de>
Cc: linux-raid <linux-raid@vger.kernel.org>, axboe <axboe@kernel.dk>
Subject: Re: Re: [RFC PATCH] raid5: Add R5_ReadNoMerge flag which prevent bio from merging at block layer
Date: Wed, 4 Jul 2012 13:29:23 +0800	[thread overview]
Message-ID: <201207041329205003713@gmail.com> (raw)
In-Reply-To: 20120704123006.031f8b5d@notabene.brown

On 2012-07-04 10:30 NeilBrown <neilb@suse.de> Wrote:
>On Tue, 3 Jul 2012 16:52:49 +0800 majianpeng <majianpeng@gmail.com> wrote:
>
>> On 2012-07-03 14:38 NeilBrown <neilb@suse.de> Wrote:
>> >On Tue, 3 Jul 2012 14:23:41 +0800 majianpeng <majianpeng@gmail.com> wrote:
>> >
>> >> Because bios will merge at block-layer,so bios-error may caused by other
>> >> bio which be merged into to the same request.
>> >> Using this flag,it will find exactly error-sector and not do redundant
>> >> operation like re-write and re-read.
>> >> 
>> >> Signed-off-by: majianpeng <majianpeng@gmail.com>
>> >
>> >Hi,
>> > I think this patch needs a more detailed explanation.
>> >
>> >What exactly is the situation that causes a problem, and what exactly is the
>> >problem that it causes?
>> >
>> >Pretend that I don't know anything about what happens below the md level..
>> >
>> >Thanks,
>> >NeilBrown
>> >
>> >
....
>> >>  
>> >
>> >
>> How about the below explanation:
>> 
>> Because bio will be merged at block-layer,so bios-error may caused by other
>> bio which be merged into to the same request.
>> For example: if chunk_aligned_read failed, it will add bio to some stipe.
>> But because the bio-merge function,those bios at most be merged.It will like
>> the chunk_aligned_read and returen error.Then it will re-write and re-read.
>> Suppose RAID5 created by n disk and chunk-size is 512K.
>> If read 512k chunk_aligned and met error(sector 0 is media error), 
>> then add 512/4=128 stipe.If those bios merged and must be error.The rewrite operation
>> will read (n-1) * 128 and computer 128 stripe.But using this flag,we only exec one rewrite.
>> This occur in resync/repair situation and chunk-aligned-read.
>> 
>> May be using this flag,we can find exact bad-sector.Not recorded the whole request bios 
>> as bad-sector
>
>Thanks.  That make some sense.
>
>I wonder if we can just use REQ_FUA to stop requests being merged, rather
>than create a new flag.  In general we should probably be using REQ_FUA in
>all the cases where we are checking for, and trying to fix, read errors.
>
>Thanks,
>NeilBrown
>
>
Using REQ_FUA/REQ_FLUSH can have same effect.
But i think REQ_FUA/REQ_FLUSH operation do more work for example, pre_flush/post_pflush and the harddisk will do more
work.But our purpose only exec bio slonely.

      reply	other threads:[~2012-07-04  5:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-03  6:23 [RFC PATCH] raid5: Add R5_ReadNoMerge flag which prevent bio from merging at block layer majianpeng
2012-07-03  6:38 ` NeilBrown
2012-07-03  8:52   ` majianpeng
2012-07-04  2:30     ` NeilBrown
2012-07-04  5:29       ` majianpeng [this message]

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=201207041329205003713@gmail.com \
    --to=majianpeng@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=linux-raid@vger.kernel.org \
    --cc=neilb@suse.de \
    /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).