From: Zheng Liu <gnehzuil.liu@gmail.com>
To: linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: [RFC] jbd2: reduce the number of writes when commiting a transacation
Date: Fri, 20 Apr 2012 19:06:27 +0800 [thread overview]
Message-ID: <20120420110627.GA30373@gmail.com> (raw)
Hi list,
In this thread[1], I found a defect in jbd2 because it needs two wrties
to finish a transacation because it writes journal header and data to
disk and it will write commit to disk after above writes are done.
AFAIK, in jbd2, it will call submit_bh twice at least to write the data
because journal header, data and commit are stored in different
buffer_heads. If we don't call them separately, these calls might be
out of order. Obviously, it must ensure that journal header and data are
written before commit. But this brings a huge overhead in this
benchmark[2]. So, IMHO, if we could use *bio* to store these data
rather than buffer_head, we could avoid this overhead because we can
call submit_bio only once to write all of data, which contains journal
header, data and commit. Here is an issue that I don't determine. If
we use submit_bio to write journal data, it will make all of data with
WRITE_FLUSH_FUA flag. But now there is only commit data with this flag.
I am not sure whether or not it brings some other unpridictable
problems. :(
Please feel free to comment this RFC. Thank you.
1. http://www.spinics.net/lists/linux-ext4/msg31637.html
2. benchmark: time for((i=0;i<2000;i++)); do \
dd if=/dev/zero of=/mnt/sda1/testfile conv=notrunc bs=4k \
count=1 seek=`expr $i \* 16` oflag=sync,direct 2>/dev/null; \
done
Regards,
Zheng
next reply other threads:[~2012-04-20 10:59 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-20 11:06 Zheng Liu [this message]
2012-04-20 11:21 ` [RFC] jbd2: reduce the number of writes when commiting a transacation Andreas Dilger
2012-04-23 2:25 ` Zheng Liu
2012-04-23 6:24 ` Andreas Dilger
2012-04-23 7:23 ` Zheng Liu
2012-04-23 22:19 ` djwong
2012-04-24 19:41 ` Ted Ts'o
2012-04-25 20:34 ` djwong
2012-04-24 21:57 ` Jan Kara
2012-04-25 1:27 ` Ted Ts'o
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=20120420110627.GA30373@gmail.com \
--to=gnehzuil.liu@gmail.com \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-fsdevel@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).