Re: PATCH: rewritten bdflush

Jan Gyselinck (wodan@penguin.digibel.org)
Fri, 14 May 1999 10:31:48 +0200


Hi

I wrote the patch for update so that it doesn't flush buffers when no disk
activity occurs. It is true that my first patch used /proc/interrupts, but
this is know changed to /proc/stats (something Pavel sugested).

If you want to be sure that there are no buffers to flush (so that, with your
patch, the disk can spin down), you will have to kill all running daemons.
They all read some file, touch a dir, or something like that. And that means,
flushing the changed atimes to disk. With my patch (or with Pavel's bdflush)
I can force my disk to be silent for 12 hours (or more, if you like to).
I don't have to be afraid that I loose any data, because a portable has a
build in UPS (they call it a battery :).

I can tell you that, from experience (and testing), my updated acurate is
in knowing when it can flush or not. It only writes something to disk
when it sees that something has been written to disk in the last 30 seconds.
Knowing when a disk is spun up or down is not interesting, becasue if you
have a timeout of 10 minutes, and every minute update flushes buffers when
the disk spins, your disk will never (or almost never) spin down, because
every time you write something, it will take another 10 minutes before the disk
goes down. Using /proc/stats seems the best way, unless you want to do
such thing internally in the kernel.

Jan Gyselinck

(if the maintainer of updated reads this, please send me an e-mail, i'll resend you
my updated-patch ... thx)

On Wed, May 12, 1999 at 08:49:37AM -0400, Zack Weinberg wrote:
> On Wed, 12 May 1999 04:00:23 +0200, Marc Lehmann wrote:
> >On Tue, May 11, 1999 at 12:13:30PM -0400, Zack Weinberg wrote:
> >>
> >> There is one notable side effect: you don't have to run the user space
> >> update anymore, bdflush wakes up every so often all by itself. I
> >
> >How about notebook users who have configured update to stop writing out
> >buffers and spin down disks after some idle time?
> >
> >Does you patch implement something similar or do we need to spin up drives
> >every 5 seconds? ;)
>
> No, the patch doesn't do anything like that. However, it seems to me
> that if your system really is idle, there won't be any dirty buffers
> to flush, and the disk will spin down anyway. It also seems to me
> that it is unsafe behavior to postpone flushing dirty buffers just
> because the disk has spun down. Finally, does anyone necessarily know
> when the disk is spun down? You'd need something in the disk driver,
> and there doesn't seem to be anything like that. The versions of
> update that `know' this seem to do it by looking at /proc/interrupts,
> which is unreliable.
>
> zw
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.rutgers.edu
> Please read the FAQ at http://www.tux.org/lkml/
>

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