Re: Is there a way to keep the 2.6 kjournald from writing to idle disks? (to allow spin-downs)

From: Bill Davidsen
Date: Tue Jan 27 2004 - 13:47:11 EST


On Tue, 27 Jan 2004, Bart Samwel wrote:

> bill davidsen wrote:
> > In article <20040125205219.GE26600@xxxxxxxxxxxxx>,
> > Micha Feigin <michf@xxxxxxxxxxxxxx> wrote:
> >
> > | There are two things to do. First you should mount the disk with the
> > | noatime option.
> >
> > Hopefully on an idle system there isn't any access, so there isn't any
> > atime impact. It would be nice if the atime write was very lazy, as in
> > only when the file is closed or something. Like an atimeonclose option.
>
> > | The other thing is ext3 which is updating its journal every 5
> > | seconds. I was told that laptop-mode was imported into 2.6 by now (I
> > | think that it is in the main stream). Check the kernel docs there
> > | should be some mount option to state the dirty time for the ext3
> > | journal. The method changed since 2.4 so I don't remember the 2.6
> > | option since I don't use it yet, sorry.
> >
> > Someone will have to explain that one, in a normal mount I would not
> > expect an idle system to be doing anything on the filesystems.
>
> Anything that reads anything from a filesystem updates the atime, I
> guess, even though the read data comes from the cache. This means that
> pages are dirtied, and they need to be written back. The atime is part
> of the filesystem metadata, so that might explain metadata journaling
> activity. AFAICS your system is not truly idle w.r.t the disk in
> question.

Well, it's the o.p. system, not mine, but I don't see how noatime will
help him, the atime shouldn't change unless he's doing disk access, and
if he's doing disk access the disk will spin up anyway.

The place noatime helps is when actually doing reads to open files, and
getting an inode update free with every read. His problem is that
something really is accessing the drive, and he won't get the desired
spindown until that's addressed.

> Mount it with noatime and see if you can spin it down when you
> know it should really be idle. (You can use hdparm -y on it to spin it
> down by hand, so you don't have to wait for the hardware timer.) If it
> still spins up without atime, you know it isn't really idle, so you need
> to find out what app is accessing the disk. A look at the output of
> "lsof" can be enlightening. If that doesn't help, you can try to use
> laptop mode's block_dump functionality (without enabling laptop mode
> itself!) to see which process is reading/writing which block.
>
> Laptop mode is not in 2.6 mainstream yet, it can be found in the -mm
> series. After you're done using block_dump you can get rid of laptop
> mode again: you don't need the actual mode, the spun-down times it gets
> you are way too short for your needs. Furthermore it's indiscriminate
> w.r.t disks, so it would have an undesired effect on your other disk as
> well.

I hope the original poster is following this ;-)

--
bill davidsen <davidsen@xxxxxxx>
CTO, TMR Associates, Inc
Doing interesting things with little computers since 1979.

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