From: Lachlan McIlroy <lachlan@sgi.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: xfs-dev <xfs-dev@sgi.com>, xfs-oss <xfs@oss.sgi.com>
Subject: Re: [PATCH] Prevent extent btree block allocation failures
Date: Mon, 16 Jun 2008 13:57:52 +1000 [thread overview]
Message-ID: <4855E4C0.4090309@sgi.com> (raw)
In-Reply-To: <20080613134418.GA31720@infradead.org>
Christoph Hellwig wrote:
> On Fri, Jun 13, 2008 at 05:38:12PM +1000, Lachlan McIlroy wrote:
>> This change fixes xfs_bmap_extents_to_btree(), xfs_bmap_local_to_extents(),
>> xfs_bmbt_split() and xfs_bmbt_newroot() so that they can search other AGs
>> for the space needed. Since we have reserved the space these allocations
>> are now guaranteed to succeed.
>
> This looks good and makes lot of sense to me. Please also add a comment
> to enum xfs_alloctype in xfs_alloc.h about the danger of the allocation
> types that never go out of the AG when used inside transactions.
The flags already have comments? Are you referring specifically to the
fact we have reserved space somewhere in the filesystem but expect to find
it in a single AG?
>
>> In order to search all AGs I had to revert
>> a change made to xfs_alloc_vextent() that prevented a search from looking
>> at AGs lower than the starting AG. This original change was made to prevent
>> out of order AG locking when allocating multiple extents on data writeout
>> but since we only allocate one extent at a time now this particular problem
>> can't happen.
>
> This one also makes sense, but I have a very bad gut feeling about it.
> There's nothing preventing the same deadlock scenario from coming back
> when people modify the highlevel data allocator again. We really need
> some sort of assert to trigger early in that case to not got a nasty
> hard to trigger deadlock.
Yes I agree. I was thinking about making the allocation of a second data
extent in the same transaction a conditional try operation to avoid the
deadlock. If a caller to the allocator provides room to return more than
one extent then I don't think we have to return more than one - multiple
extents in one transaction is just an optimisation.
>
>> + if (++(args->agno) == mp->m_sb.sb_agcount)
>
> and while we're at it this should be
>
> if (++args->agno == mp->m_sb.sb_agcount)
Done, thanks.
next prev parent reply other threads:[~2008-06-16 3:53 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-13 7:38 [PATCH] Prevent extent btree block allocation failures Lachlan McIlroy
2008-06-13 13:44 ` Christoph Hellwig
2008-06-16 3:57 ` Lachlan McIlroy [this message]
2008-06-13 15:57 ` Dave Chinner
2008-06-16 6:11 ` Lachlan McIlroy
2008-06-16 17:10 ` Dave Chinner
2008-06-17 1:58 ` Lachlan McIlroy
2008-06-17 7:39 ` Dave Chinner
2008-06-19 7:28 ` Lachlan McIlroy
2008-06-20 5:21 ` Dave Chinner
2008-06-23 5:20 ` Dave Chinner
2008-06-23 5:57 ` Lachlan McIlroy
2008-06-23 6:14 ` Dave Chinner
2008-06-23 6:40 ` Lachlan McIlroy
2008-06-23 8:05 ` Dave Chinner
2008-06-23 5:24 ` Lachlan McIlroy
2008-06-23 6:21 ` Dave Chinner
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=4855E4C0.4090309@sgi.com \
--to=lachlan@sgi.com \
--cc=hch@infradead.org \
--cc=xfs-dev@sgi.com \
--cc=xfs@oss.sgi.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