linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vishal Verma <vverma@digitalocean.com>
To: Song Liu <song@kernel.org>
Cc: linux-raid <linux-raid@vger.kernel.org>,
	Jens Axboe <axboe@kernel.dk>,
	rgoldwyn@suse.de
Subject: Re: [PATCH v6 4/4] md: raid456 add nowait support
Date: Sat, 25 Dec 2021 21:02:51 -0700	[thread overview]
Message-ID: <b80a0898-af7f-ec1b-9f4e-6d24cdb2e38a@digitalocean.com> (raw)
In-Reply-To: <CAPhsuW5m69F19w85N67WGSZfTgPfkgQv0zhYk7uGXwzkoAJh_w@mail.gmail.com>


On 12/25/21 5:07 PM, Song Liu wrote:
> On Sat, Dec 25, 2021 at 2:13 PM Vishal Verma <vverma@digitalocean.com> wrote:
>>
>> On 12/25/21 12:28 AM, Vishal Verma wrote:
>>>
>>> On 12/24/21 7:14 PM, Song Liu wrote:
>>>> On Tue, Dec 21, 2021 at 12:06 PM Vishal Verma<vverma@digitalocean.com>  wrote:
>>>>> Returns EAGAIN in case the raid456 driver would block
>>>>> waiting for situations like:
>>>>>
>>>>>     - Reshape operation,
>>>>>     - Discard operation.
>>>>>
>>>>> Signed-off-by: Vishal Verma<vverma@digitalocean.com>
>>>> I think we will need the following fix for raid456:
>>> Ack
>>>> ============================ 8< ============================
>>>>
>>>> diff --git i/drivers/md/raid5.c w/drivers/md/raid5.c
>>>> index 6ab22f29dacd..55d372ce3300 100644
>>>> --- i/drivers/md/raid5.c
>>>> +++ w/drivers/md/raid5.c
>>>> @@ -5717,6 +5717,7 @@ static void make_discard_request(struct mddev
>>>> *mddev, struct bio *bi)
>>>>                           raid5_release_stripe(sh);
>>>>                           /* Bail out if REQ_NOWAIT is set */
>>>>                           if (bi->bi_opf & REQ_NOWAIT) {
>>>> +                               finish_wait(&conf->wait_for_overlap, &w);
>>>>                                   bio_wouldblock_error(bi);
>>>>                                   return;
>>>>                           }
>>>> @@ -5734,6 +5735,7 @@ static void make_discard_request(struct mddev
>>>> *mddev, struct bio *bi)
>>>>                                   raid5_release_stripe(sh);
>>>>                                   /* Bail out if REQ_NOWAIT is set */
>>>>                                   if (bi->bi_opf & REQ_NOWAIT) {
>>>> +
>>>> finish_wait(&conf->wait_for_overlap, &w);
>>>>                                           bio_wouldblock_error(bi);
>>>>                                           return;
>>>>                                   }
>>>> @@ -5829,7 +5831,6 @@ static bool raid5_make_request(struct mddev
>>>> *mddev, struct bio * bi)
>>>>           last_sector = bio_end_sector(bi);
>>>>           bi->bi_next = NULL;
>>>>
>>>> -       md_account_bio(mddev, &bi);
>>>>           /* Bail out if REQ_NOWAIT is set */
>>>>           if ((bi->bi_opf & REQ_NOWAIT) &&
>>>>               (conf->reshape_progress != MaxSector) &&
>>>> @@ -5837,9 +5838,11 @@ static bool raid5_make_request(struct mddev
>>>> *mddev, struct bio * bi)
>>>>               ? (logical_sector > conf->reshape_progress &&
>>>> logical_sector <= conf->reshape_safe)
>>>>               : (logical_sector >= conf->reshape_safe && logical_sector
>>>> < conf->reshape_progress))) {
>>>>                   bio_wouldblock_error(bi);
>>>> +               if (rw == WRITE)
>>>> +                       md_write_end(mddev);
>>>>                   return true;
>>>>           }
>>>> -
>>>> +       md_account_bio(mddev, &bi);
>>>>           prepare_to_wait(&conf->wait_for_overlap, &w, TASK_UNINTERRUPTIBLE);
>>>>           for (; logical_sector < last_sector; logical_sector +=
>>>> RAID5_STRIPE_SECTORS(conf)) {
>>>>                   int previous;
>>>>
>>>> ============================ 8< ============================
>>>>
>>>> Vishal, please try to trigger all these conditions (including raid1,
>>>> raid10) and make sure
>>>> they work properly.
>>>>
>>>> For example, I triggered raid5 reshape and used something like the
>>>> following to make
>>>> sure the logic is triggered:
>>>>
>>>> diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
>>>> index 55d372ce3300..e79de48a0027 100644
>>>> --- a/drivers/md/raid5.c
>>>> +++ b/drivers/md/raid5.c
>>>> @@ -5840,6 +5840,11 @@ static bool raid5_make_request(struct mddev
>>>> *mddev, struct bio * bi)
>>>>                   bio_wouldblock_error(bi);
>>>>                   if (rw == WRITE)
>>>>                           md_write_end(mddev);
>>>> +               {
>>>> +                       static int count = 0;
>>>> +                       if (count++ < 10)
>>>> +                               pr_info("%s REQ_NOWAIT return\n", __func__);
>>>> +               }
>>>>                   return true;
>>>>           }
>>>>           md_account_bio(mddev, &bi);
>>>>
>>>> Thanks,
>>>> Song
>>>>
>>> Sure, will try this and verify for raid1/10.
> Please also try test raid5 with discard. I haven't tested those two
> conditions yet.
Ack.
>
>> I am running into an issue during raid10 reshape. I can see the nowait
>> code getting triggered during reshape, but it seems like the reshape
>> operation was stuck as soon as I issued write IO using FIO to the array
>> during reshape.
>> FIO also seem stuck i.e no IO went through...
> Maybe the following could fix it?
>
> Thanks,
> Song
Hmm no luck, still the same issue.
> diff --git i/drivers/md/raid10.c w/drivers/md/raid10.c
> index e2c524d50ec0..291eceaeb26c 100644
> --- i/drivers/md/raid10.c
> +++ w/drivers/md/raid10.c
> @@ -1402,14 +1402,14 @@ static void raid10_write_request(struct mddev
> *mddev, struct bio *bio,
>               : (bio->bi_iter.bi_sector + sectors > conf->reshape_safe &&
>                  bio->bi_iter.bi_sector < conf->reshape_progress))) {
>                  /* Need to update reshape_position in metadata */
> -               mddev->reshape_position = conf->reshape_progress;
> -               set_mask_bits(&mddev->sb_flags, 0,
> -                             BIT(MD_SB_CHANGE_DEVS) |
> BIT(MD_SB_CHANGE_PENDING));
> -               md_wakeup_thread(mddev->thread);
>                  if (bio->bi_opf & REQ_NOWAIT) {
>                          bio_wouldblock_error(bio);
>                          return;
>                  }
> +               mddev->reshape_position = conf->reshape_progress;
> +               set_mask_bits(&mddev->sb_flags, 0,
> +                             BIT(MD_SB_CHANGE_DEVS) |
> BIT(MD_SB_CHANGE_PENDING));
> +               md_wakeup_thread(mddev->thread);
>                  raid10_log(conf->mddev, "wait reshape metadata");
>                  wait_event(mddev->sb_wait,
>                             !test_bit(MD_SB_CHANGE_PENDING, &mddev->sb_flags));

  reply	other threads:[~2021-12-26  4:02 UTC|newest]

Thread overview: 86+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-01 21:51 [PATCH] md: add support for REQ_NOWAIT Vishal Verma
2021-11-02  3:41 ` Li Feng
2021-11-02  5:01 ` Song Liu
2021-11-02 14:40   ` [PATCH v2] " Vishal Verma
2021-11-02 15:31     ` Jens Axboe
2021-11-02 18:35     ` Song Liu
2021-11-04  4:51       ` [PATCH v3 2/2] md: raid1 add nowait support Vishal Verma
2021-11-04  4:51         ` [PATCH v3 1/2] md: add support for REQ_NOWAIT Vishal Verma
2021-11-06 15:38           ` Guoqing Jiang
2021-11-07  0:16             ` Vishal Verma
2021-11-08 22:17           ` Song Liu
2021-11-08 22:36             ` Vishal Verma
2021-11-06 15:24         ` [PATCH v3 2/2] md: raid1 add nowait support Guoqing Jiang
2021-11-07  0:18           ` Vishal Verma
2021-11-08 22:32         ` Song Liu
2021-11-08 22:39           ` Vishal Verma
2021-11-09 20:59             ` Vishal Verma
2021-11-10 17:02               ` Song Liu
2021-11-10 17:04                 ` Vishal Verma
2021-11-10 18:14           ` [RFC PATCH v4 1/4] md: add support for REQ_NOWAIT Vishal Verma
2021-11-10 18:14             ` [RFC PATCH v4 2/4] md: raid1 add nowait support Vishal Verma
2021-11-10 18:14             ` [RFC PATCH v4 3/4] md: raid10 " Vishal Verma
2021-12-14  0:32               ` Song Liu
2021-12-14 15:27                 ` Vishal Verma
2021-11-10 18:14             ` [RFC PATCH v4 4/4] md: raid456 " Vishal Verma
2021-11-11 21:42               ` Song Liu
     [not found]                 ` <f8c2a2bc-a885-8254-2b39-fc0c969ac70d@digitalocean.com>
2021-11-19  4:07                   ` Song Liu
2021-11-19  4:20                     ` Vishal Verma
2021-12-09 16:53                     ` Vishal Verma
2021-12-09 16:59                       ` Song Liu
2021-12-09 17:01                         ` Vishal Verma
2021-12-10  2:16               ` Song Liu
2021-12-10  7:18                 ` Song Liu
2021-12-10 18:26                 ` Vishal Verma
2021-12-13  5:56                   ` Song Liu
2021-12-13 22:43                     ` Vishal Verma
2021-12-13 23:35                       ` Jens Axboe
     [not found]                         ` <78d5f029-791e-6d3f-4871-263ec6b5c09b@digitalocean.com>
2021-12-14  1:11                           ` Song Liu
2021-12-14  1:12                             ` Vishal Verma
2021-12-14 15:30                               ` Vishal Verma
2021-12-14 17:08                                 ` Song Liu
2021-12-14 18:09                                   ` Vishal Verma
2021-12-15  6:09                                   ` [PATCH v5 1/4] md: add support for REQ_NOWAIT Vishal Verma
2021-12-15  6:09                                     ` [PATCH v5 2/4] md: raid1 add nowait support Vishal Verma
2021-12-15 20:33                                       ` Song Liu
2021-12-15 22:20                                         ` Vishal Verma
2021-12-21 20:06                                           ` [PATCH v6 1/4] md: add support for REQ_NOWAIT Vishal Verma
2021-12-21 20:06                                             ` [PATCH v6 2/4] md: raid1 add nowait support Vishal Verma
2021-12-21 20:06                                             ` [PATCH v6 3/4] md: raid10 " Vishal Verma
2021-12-22 23:58                                               ` Song Liu
2021-12-23  1:47                                               ` Song Liu
2021-12-21 20:06                                             ` [PATCH v6 4/4] md: raid456 " Vishal Verma
2021-12-21 22:02                                               ` John Stoffel
2021-12-25  2:14                                               ` Song Liu
     [not found]                                                 ` <aadc6d52-bc6e-527a-3b9c-0be225f9b727@digitalocean.com>
2021-12-25 22:13                                                   ` Vishal Verma
2021-12-26  0:07                                                     ` Song Liu
2021-12-26  4:02                                                       ` Vishal Verma [this message]
2021-12-26 21:20                                                         ` Vishal Verma
2021-12-22 16:06                                             ` [PATCH v6 1/4] md: add support for REQ_NOWAIT Jens Axboe
2021-12-23  1:22                                             ` Song Liu
2021-12-23  2:57                                             ` Song Liu
2021-12-23  3:08                                               ` Vishal Verma
2022-01-02  0:11                                               ` Song Liu
2022-01-02  2:08                                                 ` Vishal Verma
2021-12-23  8:36                                             ` Christoph Hellwig
2021-12-15  6:09                                     ` [PATCH v5 3/4] md: raid10 add nowait support Vishal Verma
2021-12-15 20:42                                       ` Song Liu
2021-12-15 22:20                                         ` Vishal Verma
2021-12-16  0:30                                           ` Vishal Verma
2021-12-16 16:40                                             ` Vishal Verma
2021-12-16 16:42                                             ` Jens Axboe
2021-12-16 16:45                                               ` Vishal Verma
2021-12-16 18:49                                                 ` Jens Axboe
2021-12-16 19:40                                                   ` Vishal Verma
2021-12-16 20:18                                                     ` Song Liu
2021-12-16 20:37                                                       ` Vishal Verma
2021-12-16 23:50                                                         ` Song Liu
     [not found]                                                           ` <bd90d6e6-adb4-2696-3110-fad0b1ee00dc@digitalocean.com>
2021-12-21  8:13                                                             ` Song Liu
2021-12-21 15:29                                                               ` Vishal Verma
2021-12-21 15:59                                                                 ` Jens Axboe
2021-12-21 16:26                                                                   ` Vishal Verma
2021-12-16 18:14                                               ` Vishal Verma
2021-12-15  6:09                                     ` [PATCH v5 4/4] md: raid456 " Vishal Verma
2021-12-15 20:02                                     ` [PATCH v5 1/4] md: add support for REQ_NOWAIT Song Liu
2021-12-14  0:36                       ` [RFC PATCH v4 4/4] md: raid456 add nowait support Song Liu
2021-12-13 23:50             ` [RFC PATCH v4 1/4] md: add support for REQ_NOWAIT 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=b80a0898-af7f-ec1b-9f4e-6d24cdb2e38a@digitalocean.com \
    --to=vverma@digitalocean.com \
    --cc=axboe@kernel.dk \
    --cc=linux-raid@vger.kernel.org \
    --cc=rgoldwyn@suse.de \
    --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).