linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Xiao Ni <xni@redhat.com>
To: Song Liu <song@kernel.org>
Cc: linux-raid <linux-raid@vger.kernel.org>, Coly Li <colyli@suse.de>,
	Guoqing Jiang <guoqing.jiang@cloud.ionos.com>,
	Heinz Mauelshagen <heinzm@redhat.com>,
	Nigel Croxon <ncroxon@redhat.com>
Subject: Re: [PATCH V3 3/4] md/raid10: improve raid10 discard request
Date: Fri, 21 Aug 2020 06:39:16 +0800	[thread overview]
Message-ID: <afca977d-40bd-ae88-58df-69d094643a63@redhat.com> (raw)
In-Reply-To: <CAPhsuW6fuhEL60Wnjr5O33+pX0Bo+xS9xVHSan6VXE6YfR-U-A@mail.gmail.com>



On 08/21/2020 06:13 AM, Song Liu wrote:
> On Thu, Aug 20, 2020 at 12:22 AM Xiao Ni <xni@redhat.com> wrote:
> [...]
>
>> +
>> +       if (conf->reshape_progress != MaxSector &&
>> +           ((bio->bi_iter.bi_sector >= conf->reshape_progress) !=
>> +            conf->mddev->reshape_backwards))
>> +               geo = conf->prev;
>> +
>> +       stripe_size = (1<<geo.chunk_shift) * geo.raid_disks;
>>
>> This could be raid_disks << chunk_shift
>>
>> +       stripe_mask = stripe_size - 1;
>>
>> Does this work when raid_disks is not power of 2?
>>
>> In test I used 5 disks to create the raid10 too, it worked well. Could you explain what
>> you worried in detail?
> Say we have geo.raid_disks == 5, and geo.chunk_shift == 8. Then we get
> stripe_size == 0x500 and stripe_mask == 0x4ff == b'100 1111 1111
> Is this the proper stripe_mask?
>
> Thanks,
> Song
>
I got it. Thanks very much. It can't use mask here to justify whether 
start/end address is aligned
with stripe size. It should check whether it's a multiple of stripe 
size. I'll send patch again after
fixing all problems.

Regards
Xiao


  reply	other threads:[~2020-08-20 22:39 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-13  8:14 [PATCH V3 0/4] md/raid10: Improve handling raid10 discard request Xiao Ni
2020-08-13  8:14 ` [PATCH V3 1/4] md/raid10: Move codes related with submitting discard bio into one function Xiao Ni
2020-08-13  8:14 ` [PATCH V3 2/4] md/raid10: extend r10bio devs to raid disks Xiao Ni
2020-08-22  9:28   ` Xiao Ni
2020-08-13  8:14 ` [PATCH V3 3/4] md/raid10: improve raid10 discard request Xiao Ni
2020-08-19 18:36   ` Song Liu
2020-08-20  7:26     ` Xiao Ni
2020-08-20  9:06       ` Xiao Ni
2020-08-20 22:45         ` Song Liu
     [not found]     ` <21012936-9397-40f9-115b-87dda93d9017@redhat.com>
2020-08-20 22:13       ` Song Liu
2020-08-20 22:39         ` Xiao Ni [this message]
2020-08-13  8:14 ` [PATCH V3 4/4] md/raid10: Improve discard request for far layout Xiao Ni
2020-08-19 18:38   ` Song Liu

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=afca977d-40bd-ae88-58df-69d094643a63@redhat.com \
    --to=xni@redhat.com \
    --cc=colyli@suse.de \
    --cc=guoqing.jiang@cloud.ionos.com \
    --cc=heinzm@redhat.com \
    --cc=linux-raid@vger.kernel.org \
    --cc=ncroxon@redhat.com \
    --cc=song@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).