[haiku-development] Re: BFS and write back problems

  • From: "François Revol" <revol@xxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Wed, 02 Apr 2008 22:51:12 +0200 CEST

> I think that we need to be very careful with this. Applications
> shouldn't ever need to flush or sync. The kernel must handle this
> automatically.
>
> The kernel really needs to flush dirty data to the disc once the
> system is "idle" after a disk operation (to be defined) for some
> time (i.e. 500ms for removeable media, 3000 ms for permanent
> storage).
>
> There is an issue with spinning down of harddisks. Usually I like my
> harddisks to spin down after 20 minutes, but I read somewhere that
> Linux had issues with that, because something is permanently writing
> to the disk. In windows I observed something similar, windows writes
> small data to disk every 20 seconds (or similar), but hdd spin down
> works anyway.

Yes, linux (actually ext3) forces journal writeback every couple of
second.
And since it maintains the access time, every file op ends up writing
to an inode, including reading something that is in the file cache.
You can change the period with an option in fstab though, I recall
using like several hours on my server so it would spin the disks down
at least (though for a server it should be avoided for data safety...).
Another option is to disable atime update (noatime option).

François.

Other related posts: