Re: [PATCH V5 5/5] md/raid10: improve discard request for far layout

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Aug 28, 2020 at 2:50 AM Xiao Ni <xni@xxxxxxxxxx> wrote:
>
>
>
> On 08/28/2020 03:03 PM, Song Liu wrote:
> > On Mon, Aug 24, 2020 at 10:43 PM Xiao Ni <xni@xxxxxxxxxx> wrote:
> >> For far layout, the discard region is not continuous on disks. So it needs
> >> far copies r10bio to cover all regions. It needs a way to know all r10bios
> >> have finish or not. Similar with raid10_sync_request, only the first r10bio
> >> master_bio records the discard bio. Other r10bios master_bio record the
> >> first r10bio. The first r10bio can finish after other r10bios finish and
> >> then return the discard bio.
> >>
> >> Signed-off-by: Xiao Ni <xni@xxxxxxxxxx>
> >> ---
> >>   drivers/md/raid10.c | 87 +++++++++++++++++++++++++++++++++++++++--------------
> >>   drivers/md/raid10.h |  1 +
> >>   2 files changed, 65 insertions(+), 23 deletions(-)
> >>
> >> diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
> >> index 257791e..f6518ea 100644
> >> --- a/drivers/md/raid10.c
> >> +++ b/drivers/md/raid10.c
> >> @@ -1534,6 +1534,29 @@ static struct bio *raid10_split_bio(struct r10conf *conf,
> >>          return bio;
> >>   }
> >>
> >> +static void raid_end_discard_bio(struct r10bio *r10bio)
> > Let's name this raid10_*
> Ok
> >
> >> +{
> >> +       struct r10conf *conf = r10bio->mddev->private;
> >> +       struct r10bio *first_r10bio;
> >> +
> >> +       while (atomic_dec_and_test(&r10bio->remaining)) {
> > Should this be "if (atomic_*"?
> >
> The usage of while is right here. For far layout, it needs far copies
> r10bio. It needs to find a method
> to know all r10bios finish. The first r10bio->remaining is used to
> achieve the target. It adds the first
> r10bio->remaining when preparing other r10bios. I was inspired by
> end_sync_request. So it should
> use while here. It needs to decrease the first r10bio remaining for
> other r10bios in the second loop.

Thanks for the explanation.

>
> Are there more things you want me to modify or add? If not, I'll send
> the v6 to rename the function
> name.  Thanks for reviewing these patches :)

1/5 to 3/5 look good so far. I applied them to md-next. I have some
comments on 4/5.

Thanks,
Song



[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux