>> AIUI a journaling filesystem provides a two-step process to achieve atomic >> writes of multiple sectors to disk -- e.g. a process wants to put some data >> into a block here (say, a file), a block there (say, a directory), etc., and >> consistency of the on-disk data structures must be preserved. The journal >> provides a two-step process whereby everything is written to the journal, >> then everything is written to disk. > That would mean all data is written to the disk twice and would make a > journaling file system twice as slow compared to a non-journaling file > system; the journal is typically on the same storage.
On rotating storage, it's definitely not that bad, since typically every file modification will involve several parts of the disk (at least the actual data and the inode, and often more), so the log only adds one head movement to the 2 or 3 already needed. Furthermore, once it's written to the log, there is no hurry to do the other writes, so they can be delayed and coalesced with other nearby writes, reducing head movement yet further. So, all in all, the performance impact can be quite varied and will heavily depend on your use case (and on how much work went into tuning the filesystem and journaling code). Stefan