Re: kjournald and disk sleeping

Andrew Morton
2001-10-22T21:21:50Z

Marcos Dione wrote:
>
> On Mon, 22 Oct 2001, Andrew Morton wrote:
>
> > Yes, this is a bit of a problem - it's probably atime updates,
> > things which write to inodes, etc. A commit will be forced within
> > five seconds of this happening.
>
> Reading journal.c I guessed that kjournald flushes thing *even if
> it doesn't have things to flush*. I guess that from commit_timeout and
> the comments on the thread process, but I can be wrong.

It's rather convoluted, but a commit fires if:

1: more than approx 1/4 of the journal has been used by the
current transaction or

2: this transaction has been open for >5 seconds.

And a commit will close off the current transaction, but will *not*
open a new one. Opening a new transaction will only happen when
new writes come in.

So there should be no commit activity on an fs which isn't being
written to.

You can watch all this happening by building with debug support and
running

echo 1 > /proc/sys/fs/jbd-debug

You may want to stop syslogd first though - otherwise you get into
this loop where commits create logs and logs create commits. Tends
to fill your logs up rather boringly.

-