From: Neil Brown <neilb@suse.de>
To: "Trela, Maciej" <Maciej.Trela@intel.com>
Cc: "Kwolek, Adam" <adam.kwolek@intel.com>,
"linux-raid@vger.kernel.org" <linux-raid@vger.kernel.org>,
"Williams, Dan J" <dan.j.williams@intel.com>,
"Ciechanowski, Ed" <ed.ciechanowski@intel.com>
Subject: Re: [md PATCH 2/5] md: Enable reshape for external metadata
Date: Thu, 17 Jun 2010 20:35:19 +1000 [thread overview]
Message-ID: <20100617203519.681a7586@notabene.brown> (raw)
In-Reply-To: <BE2BFE91933D1B4089447C64486040801E8E686C@irsmsx503.ger.corp.intel.com>
On Thu, 17 Jun 2010 10:40:36 +0100
"Trela, Maciej" <Maciej.Trela@intel.com> wrote:
> >
> > >
> > > Another thing is waiting during reshape for metadata update on
> > MD_CHANGE_DEVS flag.
> > > To roll reshape I've added the following code (instead calling
> > md_ubdate_sb()):
> >
> > Yes, there is a real issue there...
> >
> > I don't think we ever need the kernel to wait for an external metadata
> > handler
> > to respond to device changes (apart from failure which is handled
> > separately).
> > So maybe the best thing is to guard all settings of MD_CHANGE_DEVS with
> > if (mddev->persistent)
> >
> > I think that would be best, but I've make a note to review that later.
> >
>
> Neil,
> from what I see in the raid5.c/md.c "native" code uses MD_CHANGE_DEVS
> during the reshape if it reaches special points when metadata
> write is really needed to update the reshape checkpoint.
> In reshape_request():
> /* Cannot proceed until we've updated the superblock */
> ..
> set_bit(MD_CHANGE_DEVS, mddev->flags)
>
> In md_check_recovery() we have:
> if (mddev->flags)
> md_update_sb()
>
> Couldn't we follow this logic with MD_CHANGE_DEVS for external metadata?
> If not, how to detect the need for migration checkpoint update?
Good question.
The first question to ask is
How does mdmon know when a metadata update is required, and how does
it tell md that the metadata update is complete.
OK, 2 first questions...
For the first I suspect it should watch 'md/reshape_position' (which need to
use sysfs_notify for).
For the second .... I don't know.
- Maybe sync_action could change to 'paused' and mdmon writes 'continue'....
but that is possibly overloading that file too much.
- We could have a new sysfs file which just shows paused/active ??
- We could require that mdmon sets 'sync_max' appropriately so that reshape
will stop at the right place, and then when mdmon has updated the metadata,
it sets a new sync_max value.
- As above, but if sync_max is set too high, it is automatically reduced
to the place when raid5 finds that it has to stop
I think the last one is probably best.
Before updating ->reshape_position, raid5 checks ->resync_max and if it is
too high for safety it set is lower to a safer value.
Then it changes ->reshape_position and calls sysfs_notify.
mdmon watches for 'reshape_postion' to change. when it does it updates the
metadata and then writes a larger value to ->resync_max.
Things can get a little confusing when reshaping to fewer devices as
reshape_position decreases, but sync_completed always increases and sync_max
is still an 'upper' limit.
But it should work OK.
Does that seem reasonable?
NeilBrown
next prev parent reply other threads:[~2010-06-17 10:35 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-09 14:21 [md PATCH 2/5] md: Enable reshape for external metadata Kwolek, Adam
2010-06-16 4:53 ` Neil Brown
2010-06-16 14:52 ` Kwolek, Adam
2010-06-17 6:11 ` Neil Brown
2010-06-17 9:40 ` Trela, Maciej
2010-06-17 10:35 ` Neil Brown [this message]
2010-06-17 13:19 ` Trela, Maciej
2010-06-17 16:49 ` Kwolek, Adam
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=20100617203519.681a7586@notabene.brown \
--to=neilb@suse.de \
--cc=Maciej.Trela@intel.com \
--cc=adam.kwolek@intel.com \
--cc=dan.j.williams@intel.com \
--cc=ed.ciechanowski@intel.com \
--cc=linux-raid@vger.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).