From: Christoph Hellwig <hch@infradead.org>
To: NeilBrown <neilb@suse.com>
Cc: Christoph Hellwig <hch@infradead.org>,
Shaohua Li <shli@kernel.org>,
linux-raid@vger.kernel.org, linux-block@vger.kernel.org
Subject: Re: "creative" bio usage in the RAID code
Date: Mon, 14 Nov 2016 00:57:20 -0800 [thread overview]
Message-ID: <20161114085720.GB8405@infradead.org> (raw)
In-Reply-To: <87vavrj8jp.fsf@notabene.neil.brown.name>
On Mon, Nov 14, 2016 at 09:53:46AM +1100, NeilBrown wrote:
> > While we're at it - I find the way MD_RECOVERY_REQUESTED is used highly
> > confusing, and I'm not 100% sure it's correct. After all we check it
> > in r1buf_pool_alloc, which is a mempool alloc callback, so we rely
> > on these callbacks being done after the flag has been raise / cleared,
> > which makes me bit suspicious, and also question why we even need the
> > mempool.
>
> MD_RECOVERY_REQUEST is only set or cleared when no recovery is running.
> The ->reconfig_mutex and MD_RECOVERY_RUNNING flags ensure there are no
> races there.
> The r1buf_pool mempool is created are the start of resync, so at that
> time MD_RECOVERY_RUNNING will be stable, and it will remain stable until
> after the mempool is freed.
>
> To perform a resync we need a pool of memory buffers. We don't want to
> have to cope with kmalloc failing, but are quite able to cope with
> mempool_alloc() blocking.
> We probably don't need nearly as many bufs as we allocate (4 is probably
> plenty), but having a pool is certainly convenient.
Would it be good to create/delete the pool explicitly through methods
to start/emd the sync? Right now the behavior looks very, very
confusing.
> The "bigger bio" might cover a large number of sectors. If there are
> media errors, there might be only one sector that is bad. So we repeat
> the read with finer granularity (pages in the current code, though
> device block would be ideal) and only recovery bad blocks for individual
> pages which are bad and cannot be fixed.
i have no problems with the behavior - the point is that these days
this should be without poking into the bio internals, but by using
a bio iterator for just the range you want to re-read. Potentially
using a bio clone if we can't reusing the existing bio, although I'm
not sure we even need that from looking at the code.
next prev parent reply other threads:[~2016-11-14 8:57 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-10 19:46 "creative" bio usage in the RAID code Christoph Hellwig
2016-11-11 19:02 ` Shaohua Li
2016-11-12 17:42 ` Christoph Hellwig
2016-11-13 22:53 ` NeilBrown
2016-11-14 8:57 ` Christoph Hellwig [this message]
2016-11-14 9:51 ` NeilBrown
2016-11-15 0:13 ` Shaohua Li
2016-11-15 1:30 ` Ming Lei
2016-11-13 23:03 ` NeilBrown
2016-11-14 8:51 ` Christoph Hellwig
2016-11-14 9:43 ` NeilBrown
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=20161114085720.GB8405@infradead.org \
--to=hch@infradead.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-raid@vger.kernel.org \
--cc=neilb@suse.com \
--cc=shli@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).