From: Jan Kara <jack@suse.cz>
To: Kailas Joshi <kailas.joshi@gmail.com>
Cc: tytso@mit.edu, Jan Kara <jack@suse.cz>,
linux-ext4@vger.kernel.org, Jiaying Zhang <jiayingz@google.com>
Subject: Re: Help on Implementation of EXT3 type Ordered Mode in EXT4
Date: Mon, 22 Mar 2010 17:52:09 +0100 [thread overview]
Message-ID: <20100322165209.GB4754@quack.suse.cz> (raw)
In-Reply-To: <38f6fb7d1003182023j5513640csdc797adb49393ea0@mail.gmail.com>
Hi,
On Fri 19-03-10 08:53:08, Kailas Joshi wrote:
> I am facing some problems while implementing alloc_on_commit.
> While performing exhaustive write operations(for example using postmark),
> system locks up after some time.
> It runs fine for (simple)non-exhaustive write operations.
>
> I am using filemap_write_and_wait() in journal commit callback for
> performing synchronous block allocation. It uses special journal handle
> which enables use of early reservations.
> Is it right to use this function here? If no, is there any other alternative
> that should be used in this scenario?
>
> I am using following strategy -
> 1) ext4_da_get_block_prep() marks delayed-allocation buffers with BH_DA
> after reserving space for them.
We have a BH_Delay flag for this already. OK, probably you need a
temporary flag which you can clear in ext4_da_write_begin. I'd find
counting number of BH_Delay buffers before and after block_write_begin
call nicer...
> 2) ext4_da_write_begin() counts the number of buffers marked with BH_DA and
> reserves credits for block allocation.
> 3) journal_stop() accumulates the unused credits of a handle in the
> transaction.
> 4) journal_start() when called with nblocks=0, creates a special handle with
> the credits accumulated by all previous handles(by step 2).
This is a hack. I'd rather create a separate JBD2 function for this.
> 5) journal_commit() creates special handle for block allocation(as in step
> 4) and calls filemap_write_and_wait() to perform block allocation.
>
> I am also sending the patch(for kernel 2.6.32.4) for my implementation (also
> available at
> http://www.cse.iitb.ac.in/~kailasjoshi/files/alloc_on_commit.patch).
>
> Being new to filesystem development, I am not able to identify the problem.
> I will be very greatful if someone can help me out.
Probably you are hitting some lock inversion problem. I suggest you
compile the kernel with lockdep enabled (in Kernel hacking -> Lock debugging
-> Prove lock correctness or something like that) and see whether it issues
some warnings. If not, you can get backtraces of the locked up processes
by pressing Alt-Sysrq-w (or echo "w" >/proc/sysrq-trigger).
Honza
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
next prev parent reply other threads:[~2010-03-22 16:51 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-04 5:45 Help on Implementation of EXT3 type Ordered Mode in EXT4 Kailas Joshi
2010-02-09 16:05 ` Jan Kara
2010-02-09 17:41 ` tytso
[not found] ` <38f6fb7d1002102301x278c3ddt153f570dd1423074@mail.gmail.com>
2010-02-11 7:32 ` Kailas Joshi
2010-02-11 19:56 ` tytso
2010-02-12 3:22 ` Kailas Joshi
2010-02-12 20:07 ` tytso
2010-02-13 8:43 ` Kailas Joshi
2010-02-15 15:00 ` Jan Kara
2010-02-16 10:10 ` Kailas Joshi
2010-02-16 13:10 ` Jan Kara
2010-02-16 14:18 ` tytso
2010-02-17 15:37 ` Kailas Joshi
[not found] ` <38f6fb7d1003182023j5513640csdc797adb49393ea0@mail.gmail.com>
2010-03-22 16:52 ` Jan Kara [this message]
2010-03-23 10:41 ` Kailas Joshi
2010-03-29 15:45 ` Jan Kara
2010-04-17 4:42 ` Kailas Joshi
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=20100322165209.GB4754@quack.suse.cz \
--to=jack@suse.cz \
--cc=jiayingz@google.com \
--cc=kailas.joshi@gmail.com \
--cc=linux-ext4@vger.kernel.org \
--cc=tytso@mit.edu \
/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).