From: NeilBrown <neilb@suse.com>
To: Shaohua Li <shli@fb.com>, Christoph Hellwig <hch@lst.de>
Cc: linux-raid@vger.kernel.org
Subject: Re: [PATCH 3/3] raid5: allow r5l_io_unit allocations to fail
Date: Mon, 21 Dec 2015 09:59:48 +1100 [thread overview]
Message-ID: <87vb7s680r.fsf@notabene.neil.brown.name> (raw)
In-Reply-To: <20151218230657.GA342953@devbig084.prn1.facebook.com>
[-- Attachment #1: Type: text/plain, Size: 1950 bytes --]
On Sat, Dec 19 2015, Shaohua Li wrote:
> On Fri, Dec 18, 2015 at 12:25:35PM +0100, Christoph Hellwig wrote:
>> [can you trim your replies please? I had to trim almost 150 lines of
>> junk before getting to your reply!]
>>
>> > > spin_unlock_irqrestore(&log->io_list_lock, flags);
>> > >
>> > > or is that too simplistic?
>> >
>> > maybe add a new list and run the list at the begining of r5l_do_reclaim().
>>
>> What's the advantage of another list?
>
> I mean simply waking up reclaim thread doesn't work as r5l_do_reclaim()
> will return if reclaimable == 0. There is no guarantee reclaimable space
> is available in the allocation failure. So we'd better move the retry at
> the begining of r5l_do_reclaim(). If yes, we can't reuse the
> no_space_stripes list.
They certainly are conceptually different lists. Whether the same
linked list can be used for both is an engineering question.
One list is for updates that cannot be handled yet because the log is
full. Once the head of the log is cleared and the start pointer
updated, those requests can be handled (or some of them can).
The other list is for updates that cannot be handled yet because a
kmalloc failed. There is no clear trigger for when to handle those
again so we would need to retry quite frequently. It would be easy to
miss retrying in rare circumstances...
I wonder if we should have a mempool for these io units too.
We would allocate with GFP_ATOMIC (or similar) so the allocation woult
fail instead of blocking, but we would then know that an allocation
could only fail if there was another request in flight. So the place
where we free an io_unit would be the obviously correct place to trigger
a retry of the delayed-due-to-mem-allocation-failure stripes.
So I think I would prefer two lists, another mempool, and very well
defined places to retry the two lists. Is that over-engineering?
Thanks,
NeilBrown
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 818 bytes --]
next prev parent reply other threads:[~2015-12-20 22:59 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 [this message]
2015-12-22 15:20 ` Christoph Hellwig
2015-12-22 22:29 ` NeilBrown
2015-12-18 11:23 ` Christoph Hellwig
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=87vb7s680r.fsf@notabene.neil.brown.name \
--to=neilb@suse.com \
--cc=hch@lst.de \
--cc=linux-raid@vger.kernel.org \
--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).