I hesitate to get too fancy here, if the disk is idle we probably won't notice
the performance gain.
This is true, and would be a fairly good performance boost. It fits nicely
with the jbd trick of avoiding writes of a metadata block if a later
transaction has logged it.
But, it complicates the decision about when you're allowed to dirty a metadata
block for writeback. It used to be dirty-after-commit and it would change to
dirty-after-barrier. I suspect that is some significant surgery into jbd.
Also, since a commit isn't really done until the barrier is done, you can't
reuse blocks freed by the committing transaction until after the barrier,
which means changes in the deletion handling code.
Maybe I'm a wimp, but these are the two parts of write ahead logging I always
found the most difficult.
It might be really interesting to have a
i'm-about-to-barrier-find-some-io-to-run call. Something along the lines of
draining the dirty pages when the drive is woken up in laptop mode. There's
lots of fun with page lock vs journal lock ordering, but Jan has a handle on
that I think.
-chris
--