Re: [PATCH] jbd2: avoid the concurrent data writeback
From: Feng Tang
Date: Mon Nov 15 2010 - 04:27:20 EST
Hi Fengguang,
Thanks for the review
On Mon, 15 Nov 2010 13:54:20 +0800
"Wu, Fengguang" <fengguang.wu@xxxxxxxxx> wrote:
> [add CC to mailing lists]
>
> Tang,
>
> Good catch!
>
> On Mon, Nov 15, 2010 at 09:25:33PM +0800, Tang, Feng wrote:
> > When dd a big file to an ext4 partition, it is very likely to happen
> > that both the background flush thread and kjounald try to do data
> > writeback for it, and ext4_witepage may be called 100, 000 times by
> > journal_submit_inode_data_buffers() without really writing one page
> > back (skipped), as those pages haven't had disk blocks allocated
> > yet.
>
> The above changelog could show a bit more details (to help me
> understand it :).
OK, will update the commit log.
>
> Does it happen frequently and hence has measurable overheads?
It could always be reproduced on my Core Duo 2 + 4G RAM + SATA + EXT4 FS.
dd 1G file's time on my machine is reduced to 11.964s from 12.396s.
>
> Is it safe to skip the inode? Another alternative is to wait for it:
> with inode_wait_for_writeback(inode).
Yes, I think it's safe to skip this inode, as current
journal_submit_inode_data_buffers() will just return without do any real job
in this case, and following jbd2 transaction process will ensure the
data coherence.
Following is the updated patch, pls help to review. thanks!
- Feng
---------------