From: Theodore Tso <tytso@mit.edu>
To: Jan Kara <jack@suse.cz>
Cc: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>,
Ext4 Developers List <linux-ext4@vger.kernel.org>
Subject: Re: [PATCH] ext4: Add support for data=alloc_on_commit mode
Date: Wed, 18 Mar 2009 14:19:29 -0400 [thread overview]
Message-ID: <20090318181929.GQ15989@mit.edu> (raw)
In-Reply-To: <20090318131215.GA11965@atrey.karlin.mff.cuni.cz>
On Wed, Mar 18, 2009 at 02:12:15PM +0100, Jan Kara wrote:
> > Wouldn't this cause a deadlock ? We want to commit a transaction because
> > we don't have enough journal space (via journal_start) and now that would cause block
> > allocation which would do another journal_start()
> Yes, that's exactly what I think. We cannot start a transaction while
> committing another transaction. Also you must put the block allocation
> into the transaction you're going to commit because of data consistency
> guarantees.
> So if you want to do "alloc on commit" you have to reserve enough
> credits to the running transaction at the "block reservation" time and
> then use them for allocation at commit time. But this gets complex
> because the number of needed credits is hard to estimate (we don't know how
> many bitmaps / group descriptors we're going to modify). I'm not yet
> sure how to solve this problem...
Yeah, agreed, this is going to get tricky. What we would have to do
is estimate a worst case, and include that in the running tally, and
then subtract it off when we start allocating the data blocks.
But the problem then is what happens to new file system operations?
If we stall them, it will be a major performance hit. We can't let
them start a new transaction, because we can't have to open
transactions at the same time. If we let them continue to run against
the current transaction, then #1, we could run out of space (although
the we give ourselves 25% of the journal as "slop" space which is
extremely generous), and #2, there is a race where the new file system
operations that do delayed allocation won't get allocated on the
commit.
So this is not going to be an easy problem to solve, not without
massively complicating the jbd2 layer...
- Ted
next prev parent reply other threads:[~2009-03-18 18:19 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-17 3:19 [PATCH] ext4: Add support for data=alloc_on_commit mode Theodore Ts'o
2009-03-17 4:07 ` Eric Sandeen
2009-03-17 9:28 ` Aneesh Kumar K.V
2009-03-18 13:12 ` Jan Kara
2009-03-18 18:19 ` Theodore Tso [this message]
2009-03-18 4:18 ` Eric Sandeen
2009-03-19 16:42 ` Eric Sandeen
2009-03-19 21:50 ` Eric Sandeen
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=20090318181929.GQ15989@mit.edu \
--to=tytso@mit.edu \
--cc=aneesh.kumar@linux.vnet.ibm.com \
--cc=jack@suse.cz \
--cc=linux-ext4@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).