Re: kjournald and disk sleeping

From: Andrew Morton (akpm@zip.com.au)
Date: Mon Oct 22 2001 - 13:28:46 EST


Marcos Dione wrote:
>
> Hi. first of all, I'm not suscribed to the mailing list, so cc to
> me in the replies. thanks. and I'm running 2.4.10.
>
> what I'm doing is to try to put the disks to sleep at night, or
> when I'm not using the machine. I found what proceses to shutdown, mainly
> those that do things from time to time, like the MTA. then I send a STOP
> signal to kupdated. so far, so good. that works.
>
> then I switched to ext3 and kjournald started to appear on the
> processes list. and it commits the transactions very often.

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.

> I know I can set the commit interval to a high value, but both I don't
> know exactly how, and I think that it's not the solution I need.

That is certainly a simple way of addressing the problem, and
it does work. You'll need to edit fs/jbd/journal.c and change the `5'
in this line:

        journal->j_commit_interval = (HZ * 5);

to 3600 or whatever. I'd agree that this user interface could be
improved :) Probably a field in the journal superblock.

The result of this change is that you could lose up to an hour's work
after a crash rather than up to five seconds worth. You can manually
force a commit at any time by running /bin/sync.

Probably the best way of addressing all of this is teach ext3 to
look at the kupdate writeback interval from /proc/sys/vm/bdflush.
Users can then set the value in there to, say, one hour and it
should all just work.

 
-
-
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:31 EST