Jidong Xiao
2011-Mar-26 23:20 UTC
Ext3: Why data=journal is better than data=ordered when data needs to be read from and written to disk at the same time
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." Since this is pretty counter-intuitive, I believe many people are not aware about the root cause, thus I won't be the last one to ask this same question. Can any one kindly explain it so as to make it more clear? Thank you! Regards Jidong
Ted Ts'o
2011-Mar-26 23:53 UTC
Ext3: Why data=journal is better than data=ordered when data needs to be read from and written to disk at the same time
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