linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wang Shanker <shankerwangmiao@gmail.com>
To: antlists <antlists@youngman.org.uk>
Cc: linux-block@vger.kernel.org, linux-raid@vger.kernel.org
Subject: Re: [Bug Report] Discard bios cannot be correctly merged in blk-mq
Date: Sun, 6 Jun 2021 11:44:30 +0800	[thread overview]
Message-ID: <4456B47B-5E33-4F56-B0F9-9A95400539AB@gmail.com> (raw)
In-Reply-To: <6c407281-ee90-f577-d6db-d36211b1fdc0@youngman.org.uk>


> 2021年06月06日 06:38,antlists <antlists@youngman.org.uk> 写道:
> 
> On 05/06/2021 21:54, Wang Shanker wrote:
>> You may wonder the importance of merging discard operations. In the
>> implementation of RAID456, bios are committed in 4k trunks (they call
>> them as stripes in the code and the size is determined by DEFAULT_STRIPE_SIZE).
>> The proper merging of the bios is of vital importance for a reasonable
>> operating performance of RAID456 devices.
> 
> Note that I have seen reports (I'm not sure where or how true they are), that even when requests are sent as 512k or whatever, certain upper layers break them into 4k's, presumably expecting lower layers to merge them again.

Yes, that's true for RAID456. RAID456 is issuing 4k size requests to lower backing
device, no matter how large the request received is. That's won't be a problem
because for normal read and write operations, those 4k size requests can be
nicely merged into larger ones. Otherwise, we would be flooded with reports 
complaining about unacceptable performance of raid456.

> You might have better luck looking for and suppressing the breaking up of large chunks.

I'm quite aware that it is raid456 that is breaking the requests. It might be
better if we can avoid this in raid456. I believe it can be very difficult due to the
design of raid456 code. However, the question now is the merging is successful for
normal read/write operations, but failed for discard operations. Where lies the 
difference? I did some testing in a qemu vm and added some debug printing in the
control flow. By what I have discovered, I'm quite confident that the discard
requests are not processed the right way when merging them.

Cheers,

Miao Wang

  reply	other threads:[~2021-06-06  3:44 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-05 20:54 [Bug Report] Discard bios cannot be correctly merged in blk-mq Wang Shanker
2021-06-05 22:38 ` antlists
2021-06-06  3:44   ` Wang Shanker [this message]
2021-06-07 13:07 ` Ming Lei
2021-06-08 15:49   ` Wang Shanker
2021-06-09  0:41     ` Ming Lei
2021-06-09  2:40       ` Wang Shanker
2021-06-09  8:44         ` Xiao Ni
2021-06-09  9:03           ` Wang Shanker
2021-06-18  6:28             ` Wang Shanker
2021-06-18 12:49               ` Xiao Ni
2021-06-21  7:49                 ` Wang Shanker
2021-06-22  1:48                   ` Xiao Ni

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=4456B47B-5E33-4F56-B0F9-9A95400539AB@gmail.com \
    --to=shankerwangmiao@gmail.com \
    --cc=antlists@youngman.org.uk \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-raid@vger.kernel.org \
    /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).