Ext3: Why data=journal is better than data=ordered when data needs to be read from and written to disk at the same time

Jidong Xiao jidong.xiao at gmail.com
Sun Mar 27 00:25:23 UTC 2011


On Sat, Mar 26, 2011 at 7:53 PM, Ted Ts'o <tytso at mit.edu> wrote:
> On Sat, Mar 26, 2011 at 07:20:08PM -0400, Jidong Xiao wrote:
>> Hi,
>>
>> I see many literatures mentioned this, but I have never seen any one
>> explains it in detail.(Although this link exposed the original story:
>> http://lkml.indiana.edu/hypermail//linux/kernel/0107.1/0364.html)
>>
>> "Journal mode: This mode is the slowest except when data needs to be
>> read from and written to disk at the same time where it outperform all
>> others mode."
>
> I didn't see any reference to that in that mail thread (which seemed
> to be mostly about reiserfs).  It is true that you have a bursty,
> fsync-heavy workload, you can reduce latency by using data=journal
> mode, because it avoids seeks --- the data and metadata blocks are
> written into the journal, and this allows the fsync() to finish more
> quickly.  There are some applications where this might be useful, such
> as NFS file serving, where the NFS server is not allowed to send an
> acknowledgement back to the client until the data is written to stable
> store.
>
>                                                 - Ted
>

Well, this first time when Andrew Morton claimed that data=journal
better than data=ordered in certain conditions was when he announced
the release of ext3-2.4-0.9.4:

http://www.redhat.com/archives/ext3-users/2001-July/msg00169.html

And the link I provided in the original email actually is source or
background of this story. This release was immediately after the
previous discussion.

But my question is, why data=journal could outperform data=ordered,
for the data=journal mode, you have to write the data and metadata
blocks into the journal, but for the data=ordered mode, you only have
to write the metadata blocks into the journal. If, in some certain
cases, the former mode can avoid seeks, then the same behavior should
apply to the latter mode. So it's really odd that the former mode can
outperform the latter mode.

Regards
Jidong




More information about the Ext3-users mailing list