linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.de>
To: Shaohua Li <shli@fb.com>
Cc: linux-raid@vger.kernel.org, Kernel-team@fb.com, songliubraving@fb.com
Subject: Re: [PATCH 3/4] raid5-cache: handle flush request for journal hotadd
Date: Wed, 06 Jan 2016 13:07:30 +1100	[thread overview]
Message-ID: <87y4c3wjdp.fsf@notabene.neil.brown.name> (raw)
In-Reply-To: <20160106014704.GA4056779@devbig084.prn1.facebook.com>

[-- Attachment #1: Type: text/plain, Size: 1653 bytes --]

On Wed, Jan 06 2016, Shaohua Li wrote:

> On Wed, Jan 06, 2016 at 12:12:05PM +1100, NeilBrown wrote:
>> On Wed, Jan 06 2016, Shaohua Li wrote:
>> 
>> > When we hotadd journal for array which isn't created with journal, the
>> > array might be running write requests. Such writes aren't protected by
>> > journal yet, so we can't skip disk flush. There is no easy way to know
>> > when all such writes are finished, but the time should be enough after
>> > reclaim runs once.
>> 
>> There is an easy way to know when such writes are finished.
>> Call mddev_suspend(mddev).  This is used for the more intrusive
>> reconfiguration such as initiating a reshape.
>> I think it would be perfectly appropriate to
>>   call mddev_suspend()
>>   attach the journal
>>   call mddev_resume()
>
> hot add/remove disk is called in raid5d, we can't wait IO there.
> mddev_suspend() will wait IO. So we can't call mddev_suspend()

Fair point.  I wonder if it should be though.

Activating a spare is a very different thing to activating a journal.
Activating a spare is just one small step on the way from being degraded
to being optimal.
Activating a spare is a distinct change in how the array behaves, not
unlike adding a bitmap.

So I think that adding a journal should happen a lot like adding a
bitmap.
When you write "journal" to the 'state' file, or call ADD_NEW_DISK with
MD_DISK_JOURNAL set, ->hot_add_disk() should be called directly, a bit
like add_bound_rdev() does when adding a device to a 'linear' array.

Having remove_and_add_spares() add a journal certainly doesn't seem like
a good idea.

Thanks,
NeilBrown

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 818 bytes --]

  reply	other threads:[~2016-01-06  2:07 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-05 21:26 [PATCH 0/4]raid5-cache: fix journal hotadd Shaohua Li
2016-01-05 21:26 ` [PATCH 1/4] raid5-cache: use rcu api to access r5conf->log Shaohua Li
2016-01-06  1:04   ` NeilBrown
2016-01-05 21:26 ` [PATCH 2/4] raid5-cache: avoid write failure for journal hotadd Shaohua Li
2016-01-06  1:03   ` NeilBrown
2016-01-05 21:26 ` [PATCH 3/4] raid5-cache: handle flush request " Shaohua Li
2016-01-06  1:12   ` NeilBrown
2016-01-06  1:47     ` Shaohua Li
2016-01-06  2:07       ` NeilBrown [this message]
2016-01-05 21:26 ` [PATCH 4/4] raid5-cache: handle batch stripe " Shaohua Li

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=87y4c3wjdp.fsf@notabene.neil.brown.name \
    --to=neilb@suse.de \
    --cc=Kernel-team@fb.com \
    --cc=linux-raid@vger.kernel.org \
    --cc=shli@fb.com \
    --cc=songliubraving@fb.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).