From: Christoph Hellwig <hch@lst.de>
To: NeilBrown <neilb@suse.com>
Cc: Shaohua Li <shli@fb.com>, Christoph Hellwig <hch@lst.de>,
linux-raid@vger.kernel.org
Subject: Re: [PATCH 3/3] raid5: allow r5l_io_unit allocations to fail
Date: Fri, 18 Dec 2015 12:23:12 +0100 [thread overview]
Message-ID: <20151218112312.GA28224@lst.de> (raw)
In-Reply-To: <874mfg8qyc.fsf@notabene.neil.brown.name>
On Fri, Dec 18, 2015 at 12:51:07PM +1100, NeilBrown wrote:
> > if the reclaim thread doesn't have anything to reclaim,
> > r5l_run_no_space_stripes isn't called. we might miss the retry.
>
> so something like this:
that looks fine to me. I'll give a spin on my QA setup.
> > I'm a little worrying about the GFP_ATOMIC allocation. In the first try,
> > GFP_NOWAIT is better. And on the other hand, why sleep is bad here? We
> > could use GFP_NOIO | __GFP_NORETRY, there is no deadlock risk.
> >
> > In the retry, GFP_NOIO looks better. No deadlock too, since it's not
> > called from raid5d (maybe we shouldn't call from reclaim thread if using
> > GFP_NOIO, a workqueue is better). Otherwise we could keep retring but do
> > nothing.
>
> I did wonder a little bit about that.
> GFP_ATOMIC is (__GFP_HIGH)
> GFP_NOIO | __GFP_NORETRY is (__GFP_WAIT | __GFP_NORETRY)
>
> It isn't clear that we need 'HIGH', and WAIT with NORETRY should be OK.
> It allows __alloc_pages_direct_reclaim, but only once and never waits
> for other IO.
In general we go for HIGH on non-sleeping allocation to avoid having
the stalled. This is especially important in the I/O path.
WAIT means we will reclaim and wait for it, which looks a little dangerous
to me. In general I'd prefer not to use obscure gfp flag combination
unless there is a real need, and it's clearly documented.
next prev parent reply other threads:[~2015-12-18 11:23 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-17 22:09 raid5-cache: avoid GFP_NOFAIL allocation Christoph Hellwig
2015-12-17 22:09 ` [PATCH 1/3] raid5-cache: use a bio_set Christoph Hellwig
2015-12-17 22:09 ` [PATCH 2/3] raid5-cache: use a mempool for the metadata block Christoph Hellwig
2015-12-17 22:09 ` [PATCH 3/3] raid5: allow r5l_io_unit allocations to fail Christoph Hellwig
2015-12-17 23:48 ` Shaohua Li
2015-12-18 1:51 ` NeilBrown
2015-12-18 1:58 ` Shaohua Li
2015-12-18 11:25 ` Christoph Hellwig
2015-12-18 23:07 ` Shaohua Li
2015-12-20 22:59 ` NeilBrown
2015-12-22 15:20 ` Christoph Hellwig
2015-12-22 22:29 ` NeilBrown
2015-12-18 11:23 ` Christoph Hellwig [this message]
2015-12-20 22:51 ` NeilBrown
2015-12-17 23:31 ` raid5-cache: avoid GFP_NOFAIL allocation 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=20151218112312.GA28224@lst.de \
--to=hch@lst.de \
--cc=linux-raid@vger.kernel.org \
--cc=neilb@suse.com \
--cc=shli@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).