Linux-Raid Archives mirror
 help / color / mirror / Atom feed
From: Song Liu <song@kernel.org>
To: Yu Kuai <yukuai1@huaweicloud.com>
Cc: neilb@suse.de, linux-raid@vger.kernel.org,
	linux-kernel@vger.kernel.org,  yi.zhang@huawei.com,
	yangerkun@huawei.com, "yukuai (C)" <yukuai3@huawei.com>
Subject: Re: [PATCH -next 3/3] md: use interruptible apis in idle/frozen_sync_thread()
Date: Mon, 29 Jan 2024 23:34:41 -0800	[thread overview]
Message-ID: <CAPhsuW5-Rg8F2R-zkA5YWbjdz7TcNUsXUivDMwH+s-PxjKjAcg@mail.gmail.com> (raw)
In-Reply-To: <864b3e44-ba1b-3bfe-c17e-3e6048fbea01@huaweicloud.com>

On Mon, Jan 29, 2024 at 11:04 PM Yu Kuai <yukuai1@huaweicloud.com> wrote:
>
> Hi,
>
> 在 2024/01/30 14:37, Song Liu 写道:
> > Hi,
> >
> > Sorry for the late reply.
> >
> > The first two patches of the set look good, so I applied them to
> > md-tmp-6.9 branch. However, this one needs a respin.
>
> We are fixing dm-raid regressions, so I'll not send a new version until
> that work is done. :)

Sure. Fixing the regression is more urgent.

> >
> > On Thu, Dec 28, 2023 at 4:58 AM Yu Kuai <yukuai1@huaweicloud.com> wrote:
> >>
> >> From: Yu Kuai <yukuai3@huawei.com>
[...]
> > I found prepare_to_stop_sync_thread very hard to reason. Please try to
> > rephrase the comment or refactor the code. Maybe it makes sense to put
> > the following logic and its variations to a separate function:
> >
> >          if (prepare_to_stop_sync_thread(mddev, false)) {
> >                  wait_event(resync_wait, sync_thread_stopped(mddev, NULL));
> >                  mddev_lock_nointr(mddev);
> >          }
>
> I can do this, but there are 5 callers and only two of them can use the
> separate caller. Pehaps something like this?
>
> void stop_sync_thread(struct mddev *mddev, bool wait_sb)
> {
>         if (prepare_to_stop_sync_thread(mddev, wait_sb)) {
>                 wait_event(resync_wait, ...);
>                 if (!wait_sb) {
>                         mddev_lock_nointr(mddev);
>                         return;
>                 }
>         }
>
>         if (wait_sb) {
>                 wait_event(sb_wait, ...);
>                 mddev_lock_nointr(mddev);
>         }
> }

I don't really like this version either. Let's think more about this
after fixing the dm-raid regressions.

Thanks,
Song

>
> int stop_sync_thread_interruptible(struct mddev *mddev, bool check_sync_seq)
> {
> ...
> }

      reply	other threads:[~2024-01-30  7:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-28 12:55 [PATCH RESEND -next 0/3] md: some minor cleanups Yu Kuai
2023-12-28 12:55 ` [PATCH -next 1/3] md: remove redundant check of 'mddev->sync_thread' Yu Kuai
2023-12-28 12:55 ` [PATCH -next 2/3] md: remove redundant md_wakeup_thread() Yu Kuai
2023-12-28 12:55 ` [PATCH -next 3/3] md: use interruptible apis in idle/frozen_sync_thread() Yu Kuai
2024-01-30  6:37   ` Song Liu
2024-01-30  7:04     ` Yu Kuai
2024-01-30  7:34       ` Song Liu [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=CAPhsuW5-Rg8F2R-zkA5YWbjdz7TcNUsXUivDMwH+s-PxjKjAcg@mail.gmail.com \
    --to=song@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=neilb@suse.de \
    --cc=yangerkun@huawei.com \
    --cc=yi.zhang@huawei.com \
    --cc=yukuai1@huaweicloud.com \
    --cc=yukuai3@huawei.com \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).