Re: kjournald and disk sleeping

From: Andrew Morton (akpm@zip.com.au)
Date: Mon Oct 22 2001 - 16:17:29 EST


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.

-
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Oct 23 2001 - 21:00:33 EST