linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
To: Yu Kuai <yukuai1@huaweicloud.com>
Cc: linux-raid@vger.kernel.org, yangerkun@huawei.com,
	"yukuai (C)" <yukuai3@huawei.com>
Subject: Re: [PATCH v3 3/4] mdadm: remove bitmap file support
Date: Fri, 22 Nov 2024 08:55:55 +0100	[thread overview]
Message-ID: <20241122085555.00003318@linux.intel.com> (raw)
In-Reply-To: <122fe099-6e2b-8b1e-a9c2-d027cadb08b8@huaweicloud.com>

On Fri, 22 Nov 2024 09:13:18 +0800
Yu Kuai <yukuai1@huaweicloud.com> wrote:

> 在 2024/11/21 16:15, Mariusz Tkaczyk 写道:
> > On Thu, 21 Nov 2024 09:25:50 +0800
> > Yu Kuai <yukuai1@huaweicloud.com> wrote:
> >   
> >>> BitmapUnknown should be used only if we failed to parse bitmap setting in
> >>> cmdline. Otherwise first and default value should be always BitmapNone
> >>> because data access is always highest priority and dropping bitmap is
> >>> always safe. We can print warning in config parse failed or bitmap value
> >>> is repeated- it is reasonable. If I'm wrong here, please let me know.  
> >>
> >> Hi, there is a little difference betewwn BitmapNone and BitmapUnknow, if
> >> user doesn't pass in the "bitmap=xxx", then the BitmapUnkonw will be
> >> used to decide choosing BitmapNone or BimtapInternal based on the disk
> >> size. In Create:
> >>
> >>           if (!s->bitmap_file &&
> >>           ┊   !st->ss->external &&
> >>           ┊   s->level >= 1 &&
> >>           ┊   st->ss->add_internal_bitmap &&
> >>           ┊   s->journaldisks == 0 &&
> >>           ┊   (s->consistency_policy != CONSISTENCY_POLICY_RESYNC &&
> >>           ┊    s->consistency_policy != CONSISTENCY_POLICY_PPL) &&
> >>           ┊   (s->write_behind || s->size > 100*1024*1024ULL)) {
> >>                   if (c->verbose > 0)
> >>                           pr_err("automatically enabling write-intent
> >> bitmap on large array\n");
> >>                   s->bitmap_file = "internal";
> >>           }
> >>
> >> And I realized that I should used BitmapUnknow here, not BimtapNone.  
> > 
> > Oh yes.. Looking on that from the interface perspective suggest me that we
> > should remove it and always let user to decide. If the are not satisfied
> > with resync times they can enable bitmap in any moment but it may cause
> > functional regression for users that are used to this auto turning on.
> > 
> > Maybe, we can move it to main() and ask without checking raid size, assuming
> > that array size <100GB is used mainly for testing nowadays?
> > 
> > Here, proposal based on current code, your change may require some
> > adjustments:
> > 
> > diff --git a/mdadm.c b/mdadm.c
> > index 8cb4ba66ac20..2e803d441dd4 100644
> > --- a/mdadm.c
> > +++ b/mdadm.c
> > @@ -1535,6 +1535,13 @@ int main(int argc, char *argv[])
> >                          break;
> >                  }
> > 
> > +               if (!s->bitmap_file && !c.runstop != 1 && s->level >= 1) {
> > +                       int response = ask("To optimalize resync speed, it
> > is recommended to enable write-indent bitmap, do you want to enable it
> > now?"); +
> > +                       if (response)
> > +                               s->bitmap_file = "internal";
> > +               }
> > +
> >                  rv = Create(ss, &ident, devs_found - 1, devlist->next, &s,
> > &c); break;
> >          case MISC:
> > 
> > This is more reasonable than auto-forcing bitmap without possibility
> > to skip it (even for testing). I added c->runstop verification because it is
> > often used in Create to skip some errors and questions.
> > 
> > What do you think?  
> 
> I think it's good! I used to be curious why bitmap is not enabled by
> default for testing, and have to look into the source code.
> 
One note here (this one is easy to be missed):
If user set --bitmap=None we should not prompt this question, assuming that user
already made his decision. You need to differentiate default BitmapNone
and user defined BitmapNone (boolean is_bitmap_set should be fine, because
adding another enum status is not valuable I think).

Mariusz

  reply	other threads:[~2024-11-22  7:56 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-20  6:46 [PATCH v3 0/4] mdadm: remove bitmap file support Yu Kuai
2024-11-20  6:46 ` [PATCH v3 1/4] tests/04update-uuid: remove bitmap file test Yu Kuai
2024-11-20  6:46 ` [PATCH v3 2/4] tests/05r1-re-add-nosuper: " Yu Kuai
2024-11-20  6:46 ` [PATCH v3 3/4] mdadm: remove bitmap file support Yu Kuai
2024-11-20 10:27   ` Mariusz Tkaczyk
2024-11-21  1:25     ` Yu Kuai
2024-11-21  8:15       ` Mariusz Tkaczyk
2024-11-22  1:13         ` Yu Kuai
2024-11-22  7:55           ` Mariusz Tkaczyk [this message]
2024-11-22  8:04             ` Yu Kuai
2024-11-20  6:46 ` [PATCH v3 4/4] Manage: forbid re-add to the array without metadata Yu Kuai
2024-11-20 10:36   ` Mariusz Tkaczyk

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=20241122085555.00003318@linux.intel.com \
    --to=mariusz.tkaczyk@linux.intel.com \
    --cc=linux-raid@vger.kernel.org \
    --cc=yangerkun@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 NNTP newsgroup(s).